Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update generated code #10

Merged
merged 2 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,5 @@ FodyWeavers.xsd
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,visualstudio,intellij+all,dotnetcore,windows,macos,linux

app-settings.*.json
!app-settings.sample.json
!app-settings.sample.json
!generated/**/publish
26 changes: 18 additions & 8 deletions src/generated/Admin/AdminRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<object>("--select", description: "Select properties to be returned"));
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
command.Handler = CommandHandler.Create<object, object>(async (select, expand) => {
var requestInfo = CreateGetRequestInformation();
requestInfo.QueryParameters.Add("select", select);
requestInfo.QueryParameters.Add("expand", expand);
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
selectOption.IsRequired = false;
selectOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(selectOption);
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
expandOption.IsRequired = false;
expandOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(expandOption);
command.Handler = CommandHandler.Create<string[], string[]>(async (select, expand) => {
var requestInfo = CreateGetRequestInformation(q => {
q.Select = select;
q.Expand = expand;
});
var result = await RequestAdapter.SendAsync<ApiSdk.Models.Microsoft.Graph.Admin>(requestInfo);
// Print request output. What if the request has no return?
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
Expand All @@ -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<string>("--body"));
var bodyOption = new Option<string>("--body");
bodyOption.IsRequired = true;
command.AddOption(bodyOption);
command.Handler = CommandHandler.Create<string>(async (body) => {
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
var model = parseNode.GetObjectValue<ApiSdk.Models.Microsoft.Graph.Admin>();
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>("--body"));
var bodyOption = new Option<string>("--body");
bodyOption.IsRequired = true;
command.AddOption(bodyOption);
command.Handler = CommandHandler.Create<string>(async (body) => {
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
var model = parseNode.GetObjectValue<ServiceHealth>();
var requestInfo = CreatePostRequestInformation(model);
var requestInfo = CreatePostRequestInformation(model, q => {
});
var result = await RequestAdapter.SendAsync<ServiceHealth>(requestInfo);
// Print request output. What if the request has no return?
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
Expand All @@ -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<int?>("--top", description: "Show only the first n items"));
command.AddOption(new Option<int?>("--skip", description: "Skip the first n items"));
command.AddOption(new Option<string>("--search", description: "Search items by search phrases"));
command.AddOption(new Option<string>("--filter", description: "Filter items by property values"));
command.AddOption(new Option<bool?>("--count", description: "Include count of items"));
command.AddOption(new Option<object>("--orderby", description: "Order items by property values"));
command.AddOption(new Option<object>("--select", description: "Select properties to be returned"));
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
command.Handler = CommandHandler.Create<int?, int?, string, string, bool?, object, object, object>(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<int?>("--top", description: "Show only the first n items");
topOption.IsRequired = false;
command.AddOption(topOption);
var skipOption = new Option<int?>("--skip", description: "Skip the first n items");
skipOption.IsRequired = false;
command.AddOption(skipOption);
var searchOption = new Option<string>("--search", description: "Search items by search phrases");
searchOption.IsRequired = false;
command.AddOption(searchOption);
var filterOption = new Option<string>("--filter", description: "Filter items by property values");
filterOption.IsRequired = false;
command.AddOption(filterOption);
var countOption = new Option<bool?>("--count", description: "Include count of items");
countOption.IsRequired = false;
command.AddOption(countOption);
var orderbyOption = new Option<string[]>("--orderby", description: "Order items by property values");
orderbyOption.IsRequired = false;
orderbyOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(orderbyOption);
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
selectOption.IsRequired = false;
selectOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(selectOption);
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
expandOption.IsRequired = false;
expandOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(expandOption);
command.Handler = CommandHandler.Create<int?, int?, string, string, bool?, string[], string[], string[]>(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<HealthOverviewsResponse>(requestInfo);
// Print request output. What if the request has no return?
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>("--servicehealth-id", description: "key: id of serviceHealth"));
command.AddOption(new Option<string>("--body"));
var serviceHealthIdOption = new Option<string>("--servicehealth-id", description: "key: id of serviceHealth");
serviceHealthIdOption.IsRequired = true;
command.AddOption(serviceHealthIdOption);
var bodyOption = new Option<string>("--body");
bodyOption.IsRequired = true;
command.AddOption(bodyOption);
command.Handler = CommandHandler.Create<string, string>(async (serviceHealthId, body) => {
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
var model = parseNode.GetObjectValue<ServiceHealthIssue>();
var requestInfo = CreatePostRequestInformation(model);
if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId);
var requestInfo = CreatePostRequestInformation(model, q => {
});
var result = await RequestAdapter.SendAsync<ServiceHealthIssue>(requestInfo);
// Print request output. What if the request has no return?
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
Expand All @@ -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<string>("--servicehealth-id", description: "key: id of serviceHealth"));
command.AddOption(new Option<int?>("--top", description: "Show only the first n items"));
command.AddOption(new Option<int?>("--skip", description: "Skip the first n items"));
command.AddOption(new Option<string>("--search", description: "Search items by search phrases"));
command.AddOption(new Option<string>("--filter", description: "Filter items by property values"));
command.AddOption(new Option<bool?>("--count", description: "Include count of items"));
command.AddOption(new Option<object>("--orderby", description: "Order items by property values"));
command.AddOption(new Option<object>("--select", description: "Select properties to be returned"));
command.AddOption(new Option<object>("--expand", description: "Expand related entities"));
command.Handler = CommandHandler.Create<string, int?, int?, string, string, bool?, object, object, object>(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<string>("--servicehealth-id", description: "key: id of serviceHealth");
serviceHealthIdOption.IsRequired = true;
command.AddOption(serviceHealthIdOption);
var topOption = new Option<int?>("--top", description: "Show only the first n items");
topOption.IsRequired = false;
command.AddOption(topOption);
var skipOption = new Option<int?>("--skip", description: "Skip the first n items");
skipOption.IsRequired = false;
command.AddOption(skipOption);
var searchOption = new Option<string>("--search", description: "Search items by search phrases");
searchOption.IsRequired = false;
command.AddOption(searchOption);
var filterOption = new Option<string>("--filter", description: "Filter items by property values");
filterOption.IsRequired = false;
command.AddOption(filterOption);
var countOption = new Option<bool?>("--count", description: "Include count of items");
countOption.IsRequired = false;
command.AddOption(countOption);
var orderbyOption = new Option<string[]>("--orderby", description: "Order items by property values");
orderbyOption.IsRequired = false;
orderbyOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(orderbyOption);
var selectOption = new Option<string[]>("--select", description: "Select properties to be returned");
selectOption.IsRequired = false;
selectOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(selectOption);
var expandOption = new Option<string[]>("--expand", description: "Expand related entities");
expandOption.IsRequired = false;
expandOption.Arity = ArgumentArity.ZeroOrMore;
command.AddOption(expandOption);
command.Handler = CommandHandler.Create<string, int?, int?, string, string, bool?, string[], string[], string[]>(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<IssuesResponse>(requestInfo);
// Print request output. What if the request has no return?
using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>("--servicehealth-id", description: "key: id of serviceHealth"));
command.AddOption(new Option<string>("--servicehealthissue-id", description: "key: id of serviceHealthIssue"));
var serviceHealthIdOption = new Option<string>("--servicehealth-id", description: "key: id of serviceHealth");
serviceHealthIdOption.IsRequired = true;
command.AddOption(serviceHealthIdOption);
var serviceHealthIssueIdOption = new Option<string>("--servicehealthissue-id", description: "key: id of serviceHealthIssue");
serviceHealthIssueIdOption.IsRequired = true;
command.AddOption(serviceHealthIssueIdOption);
command.AddOption(new Option<FileInfo>("--output"));
command.Handler = CommandHandler.Create<string, string, FileInfo>(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<Stream>(requestInfo);
// Print request output. What if the request has no return?
if (output == null) {
Expand Down
Loading