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

Commit 21f7281

Browse files
andrueastmanMicrosoft Graph DevX Toolingcalebkiage
authored
feat(generation): update request builders and models (#54)
* Update generated files with build 140016 * ci: set build timeout (#57) * ci: use bigger pool for build stage * ci: fix tar format detection --------- Co-authored-by: Microsoft Graph DevX Tooling <[email protected]> Co-authored-by: Caleb Kiage <[email protected]>
1 parent 3514252 commit 21f7281

File tree

23,562 files changed

+2002285
-321181
lines changed

Some content is hidden

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

23,562 files changed

+2002285
-321181
lines changed

.azure-pipelines/powershell/BuildTools.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Class PackageTypes : System.Management.Automation.IValidateSetValuesGenerator {
22
[string[]] GetValidValues() {
33
$PackageTypes = ,"zip"
4-
if ($global:IsMacOS -or $global:IsLinux) {
4+
if (Get-Command -Name tar -CommandType Application -ErrorAction Ignore) {
55
$PackageTypes += "tar"
66
}
77
return [string[]] $PackageTypes

.azure-pipelines/release-cli.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ extends:
261261
jobs:
262262
- job: build
263263
displayName: Build and publish
264+
timeoutInMinutes: 60 # Use 1hr timeout
265+
pool:
266+
# Custom high memory pool for building the CLI
267+
name: 1es-ubuntu-latest-ado-cli-mem
268+
os: linux
264269
strategy:
265270
matrix:
266271
'Windows-x64':

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"omnisharp.organizeImportsOnFormat": true,
3-
"dotnet.defaultSolution": "msgraph-beta-cli.sln"
3+
"dotnet.defaultSolution": "msgraph-beta-cli.sln",
4+
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true
45
}

src/generated/AccessReviewDecisions/AccessReviewDecisionsRequestBuilder.cs

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// <auto-generated/>
2+
using ApiSdk.Models.ODataErrors;
3+
using Microsoft.Kiota.Abstractions.Serialization;
4+
using Microsoft.Kiota.Abstractions;
5+
using Microsoft.Kiota.Cli.Commons.Extensions;
6+
using Microsoft.Kiota.Cli.Commons.IO;
7+
using Microsoft.Kiota.Cli.Commons;
8+
using System.Collections.Generic;
9+
using System.CommandLine;
10+
using System.IO;
11+
using System.Linq;
12+
using System.Text;
13+
using System.Threading.Tasks;
14+
using System.Threading;
15+
using System;
16+
namespace ApiSdk.AccessReviewDecisions.Count {
17+
/// <summary>
18+
/// Provides operations to count the resources in the collection.
19+
/// </summary>
20+
public class CountRequestBuilder : BaseCliRequestBuilder
21+
{
22+
/// <summary>
23+
/// Get the number of the resource
24+
/// </summary>
25+
/// <returns>A <see cref="Command"/></returns>
26+
public Command BuildGetCommand()
27+
{
28+
var command = new Command("get");
29+
command.Description = "Get the number of the resource";
30+
var searchOption = new Option<string>("--search", description: "Search items by search phrases") {
31+
};
32+
searchOption.IsRequired = false;
33+
command.AddOption(searchOption);
34+
var filterOption = new Option<string>("--filter", description: "Filter items by property values") {
35+
};
36+
filterOption.IsRequired = false;
37+
command.AddOption(filterOption);
38+
command.SetHandler(async (invocationContext) => {
39+
var search = invocationContext.ParseResult.GetValueForOption(searchOption);
40+
var filter = invocationContext.ParseResult.GetValueForOption(filterOption);
41+
IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory");
42+
var cancellationToken = invocationContext.GetCancellationToken();
43+
var reqAdapter = invocationContext.GetRequestAdapter();
44+
var requestInfo = ToGetRequestInformation(q => {
45+
if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search;
46+
if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter;
47+
});
48+
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
49+
{"4XX", ODataError.CreateFromDiscriminatorValue},
50+
{"5XX", ODataError.CreateFromDiscriminatorValue},
51+
};
52+
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null;
53+
var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT);
54+
await formatter.WriteOutputAsync(response, cancellationToken);
55+
});
56+
return command;
57+
}
58+
/// <summary>
59+
/// Instantiates a new <see cref="CountRequestBuilder"/> and sets the default values.
60+
/// </summary>
61+
/// <param name="pathParameters">Path parameters for the request</param>
62+
public CountRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/accessReviewDecisions/$count{?%24filter,%24search}", pathParameters)
63+
{
64+
}
65+
/// <summary>
66+
/// Instantiates a new <see cref="CountRequestBuilder"/> and sets the default values.
67+
/// </summary>
68+
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
69+
public CountRequestBuilder(string rawUrl) : base("{+baseurl}/accessReviewDecisions/$count{?%24filter,%24search}", rawUrl)
70+
{
71+
}
72+
/// <summary>
73+
/// Get the number of the resource
74+
/// </summary>
75+
/// <returns>A <see cref="RequestInformation"/></returns>
76+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
77+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
78+
#nullable enable
79+
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<CountRequestBuilderGetQueryParameters>>? requestConfiguration = default)
80+
{
81+
#nullable restore
82+
#else
83+
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<CountRequestBuilderGetQueryParameters>> requestConfiguration = default)
84+
{
85+
#endif
86+
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
87+
requestInfo.Configure(requestConfiguration);
88+
requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9");
89+
return requestInfo;
90+
}
91+
/// <summary>
92+
/// Get the number of the resource
93+
/// </summary>
94+
public class CountRequestBuilderGetQueryParameters
95+
{
96+
/// <summary>Filter items by property values</summary>
97+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
98+
#nullable enable
99+
[QueryParameter("%24filter")]
100+
public string? Filter { get; set; }
101+
#nullable restore
102+
#else
103+
[QueryParameter("%24filter")]
104+
public string Filter { get; set; }
105+
#endif
106+
/// <summary>Search items by search phrases</summary>
107+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
108+
#nullable enable
109+
[QueryParameter("%24search")]
110+
public string? Search { get; set; }
111+
#nullable restore
112+
#else
113+
[QueryParameter("%24search")]
114+
public string Search { get; set; }
115+
#endif
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)