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

Commit 866c187

Browse files
authored
Merge pull request #503 from microsoftgraph/chore/fix-build
multiple fixes to get CI to build again
2 parents a5d2320 + c79eb95 commit 866c187

File tree

843 files changed

+36985
-15381
lines changed

Some content is hidden

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

843 files changed

+36985
-15381
lines changed

src/Microsoft.Graph.Cli.Core.Tests/IO/GraphODataPagingServiceTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public void Sets_Top_If_Value_Is_Not_Set()
2121

2222
[Theory]
2323
[InlineData(0)]
24+
#pragma warning disable xUnit1012
2425
[InlineData(null)]
26+
#pragma warning restore xUnit1012
2527
[InlineData("test")]
2628
public void Sets_Top_If_Value_Is_Invalid(object topValue)
2729
{

src/Microsoft.Graph.Cli.Core/IO/GraphCliClientFactory.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.Graph.Cli.Core.IO;
99
/// <summary>
1010
/// HTTP client factory for the graph CLI.
1111
/// </summary>
12-
public class GraphCliClientFactory
12+
public static class GraphCliClientFactory
1313
{
1414
/// <summary>
1515
/// Gets default middlewares.
@@ -49,24 +49,6 @@ public static HttpClient GetDefaultClient(GraphClientOptions? options = null, st
4949
m.Add(lh);
5050
}
5151

52-
// Set compression handler to be last (Allows logging handler to log request body)
53-
m.Sort((a, b) =>
54-
{
55-
var aMatch = a is Kiota.Http.HttpClientLibrary.Middleware.CompressionHandler;
56-
var bMatch = b is Kiota.Http.HttpClientLibrary.Middleware.CompressionHandler;
57-
if (aMatch && !bMatch)
58-
{
59-
return 1;
60-
}
61-
62-
if (bMatch && !aMatch)
63-
{
64-
return -1;
65-
}
66-
67-
return 0;
68-
});
69-
7052
return GraphClientFactory.Create(version: version, nationalCloud: environment.GraphClientCloud(), finalHandler: finalHandler, handlers: m);
7153
}
7254
}

src/sample/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static CommandLineBuilder BuildCommandLine()
146146
rootCommand.Add(new LoginCommand(builder));
147147
rootCommand.AddGlobalOption(debugOption);
148148

149-
if (rootCommand.Subcommands.FirstOrDefault(static c => c.Name == "users") is {} usersCmd)
149+
if (rootCommand.Subcommands.FirstOrDefault(static c => c.Name == "users") is { } usersCmd)
150150
{
151151
usersCmd.AddAlias("me");
152152
}
@@ -188,7 +188,7 @@ static IHostBuilder CreateHostBuilder(string[] args) =>
188188
AuthenticationStrategy authStrategy = authSettings?.Strategy ?? AuthenticationStrategy.DeviceCode;
189189
var credential = serviceFactory.GetTokenCredentialAsync(authStrategy, authSettings?.TenantId, authSettings?.ClientId, authSettings?.ClientCertificateName, authSettings?.ClientCertificateThumbPrint, authSettings?.Environment ?? CloudEnvironment.Global);
190190
credential.Wait();
191-
return new AzureIdentityAuthenticationProvider(credential.Result);
191+
return new AzureIdentityAuthenticationProvider(credential.Result, isCaeEnabled: true); // disambiguates the call to the constructor
192192
});
193193
services.AddSingleton<IRequestAdapter>(p =>
194194
{

src/sample/generated/ApiClient.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// <auto-generated/>
2+
#pragma warning disable CS0618
23
using ApiSdk.Users;
34
using Microsoft.Kiota.Abstractions.Extensions;
45
using Microsoft.Kiota.Abstractions;
@@ -15,15 +16,20 @@
1516
using System.Text;
1617
using System.Threading.Tasks;
1718
using System;
18-
namespace ApiSdk {
19+
namespace ApiSdk
20+
{
1921
/// <summary>
2022
/// The main entry point of the SDK, exposes the configuration and the fluent API.
2123
/// </summary>
22-
public class ApiClient : BaseCliRequestBuilder {
24+
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
25+
public partial class ApiClient : BaseCliRequestBuilder
26+
{
2327
/// <summary>
24-
/// Instantiates a new ApiClient and sets the default values.
28+
/// Instantiates a new <see cref="global::ApiSdk.ApiClient"/> and sets the default values.
2529
/// </summary>
26-
public Command BuildRootCommand() {
30+
/// <returns>A <see cref="Command"/></returns>
31+
public Command BuildRootCommand()
32+
{
2733
var command = new RootCommand();
2834
command.Description = "Instantiates a new ApiClient and sets the default values.";
2935
command.AddCommand(BuildUsersNavCommand());
@@ -32,10 +38,12 @@ public Command BuildRootCommand() {
3238
/// <summary>
3339
/// The users property
3440
/// </summary>
35-
public Command BuildUsersNavCommand() {
41+
/// <returns>A <see cref="Command"/></returns>
42+
public Command BuildUsersNavCommand()
43+
{
3644
var command = new Command("users");
3745
command.Description = "The users property";
38-
var builder = new UsersRequestBuilder(PathParameters);
46+
var builder = new global::ApiSdk.Users.UsersRequestBuilder(PathParameters);
3947
var execCommands = new List<Command>();
4048
var nonExecCommands = new List<Command>();
4149
nonExecCommands.Add(builder.BuildCountNavCommand());
@@ -55,9 +63,11 @@ public Command BuildUsersNavCommand() {
5563
return command;
5664
}
5765
/// <summary>
58-
/// Instantiates a new ApiClient and sets the default values.
66+
/// Instantiates a new <see cref="global::ApiSdk.ApiClient"/> and sets the default values.
5967
/// </summary>
60-
public ApiClient() : base("{+baseurl}", new Dictionary<string, object>()) {
68+
public ApiClient() : base("{+baseurl}", new Dictionary<string, object>())
69+
{
6170
}
6271
}
6372
}
73+
#pragma warning restore CS0618
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,55 @@
11
// <auto-generated/>
2+
#pragma warning disable CS0618
3+
using Microsoft.Kiota.Abstractions.Extensions;
24
using Microsoft.Kiota.Abstractions.Serialization;
35
using System.Collections.Generic;
46
using System.IO;
5-
using System.Linq;
67
using System;
7-
namespace ApiSdk.Models {
8-
public class AccessAction : IAdditionalDataHolder, IParsable {
8+
namespace ApiSdk.Models
9+
{
10+
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
11+
#pragma warning disable CS1591
12+
public partial class AccessAction : IAdditionalDataHolder, IParsable
13+
#pragma warning restore CS1591
14+
{
915
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
1016
public IDictionary<string, object> AdditionalData { get; set; }
1117
/// <summary>
12-
/// Instantiates a new accessAction and sets the default values.
18+
/// Instantiates a new <see cref="global::ApiSdk.Models.AccessAction"/> and sets the default values.
1319
/// </summary>
14-
public AccessAction() {
20+
public AccessAction()
21+
{
1522
AdditionalData = new Dictionary<string, object>();
1623
}
1724
/// <summary>
1825
/// Creates a new instance of the appropriate class based on discriminator value
1926
/// </summary>
27+
/// <returns>A <see cref="global::ApiSdk.Models.AccessAction"/></returns>
2028
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
21-
public static AccessAction CreateFromDiscriminatorValue(IParseNode parseNode) {
29+
public static global::ApiSdk.Models.AccessAction CreateFromDiscriminatorValue(IParseNode parseNode)
30+
{
2231
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
23-
return new AccessAction();
32+
return new global::ApiSdk.Models.AccessAction();
2433
}
2534
/// <summary>
2635
/// The deserialization information for the current model
2736
/// </summary>
28-
public IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
29-
return new Dictionary<string, Action<IParseNode>> {
37+
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
38+
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
39+
{
40+
return new Dictionary<string, Action<IParseNode>>
41+
{
3042
};
3143
}
3244
/// <summary>
3345
/// Serializes information the current object
3446
/// </summary>
3547
/// <param name="writer">Serialization writer to use to serialize this model</param>
36-
public void Serialize(ISerializationWriter writer) {
48+
public virtual void Serialize(ISerializationWriter writer)
49+
{
3750
_ = writer ?? throw new ArgumentNullException(nameof(writer));
3851
writer.WriteAdditionalData(AdditionalData);
3952
}
4053
}
4154
}
55+
#pragma warning restore CS0618

src/sample/generated/Models/ActionState.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// <auto-generated/>
22
using System.Runtime.Serialization;
33
using System;
4-
namespace ApiSdk.Models {
4+
namespace ApiSdk.Models
5+
{
56
/// <summary>State of the action on the device</summary>
6-
public enum ActionState {
7+
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
8+
public enum ActionState
9+
{
710
/// <summary>Not a valid action state</summary>
811
[EnumMember(Value = "none")]
912
None,
Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
// <auto-generated/>
2+
#pragma warning disable CS0618
3+
using Microsoft.Kiota.Abstractions.Extensions;
24
using Microsoft.Kiota.Abstractions.Serialization;
35
using System.Collections.Generic;
46
using System.IO;
5-
using System.Linq;
67
using System;
7-
namespace ApiSdk.Models {
8-
public class ActivityHistoryItem : Entity, IParsable {
8+
namespace ApiSdk.Models
9+
{
10+
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
11+
#pragma warning disable CS1591
12+
public partial class ActivityHistoryItem : global::ApiSdk.Models.Entity, IParsable
13+
#pragma warning restore CS1591
14+
{
915
/// <summary>Optional. The duration of active user engagement. if not supplied, this is calculated from the startedDateTime and lastActiveDateTime.</summary>
1016
public int? ActiveDurationSeconds { get; set; }
1117
/// <summary>The activity property</summary>
1218
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
1319
#nullable enable
14-
public UserActivity? Activity { get; set; }
20+
public global::ApiSdk.Models.UserActivity? Activity { get; set; }
1521
#nullable restore
1622
#else
17-
public UserActivity Activity { get; set; }
23+
public global::ApiSdk.Models.UserActivity Activity { get; set; }
1824
#endif
1925
/// <summary>Set by the server. DateTime in UTC when the object was created on the server.</summary>
2026
public DateTimeOffset? CreatedDateTime { get; set; }
21-
/// <summary>Optional. UTC DateTime when the historyItem will undergo hard-delete. Can be set by the client.</summary>
27+
/// <summary>Optional. UTC DateTime when the activityHistoryItem will undergo hard-delete. Can be set by the client.</summary>
2228
public DateTimeOffset? ExpirationDateTime { get; set; }
23-
/// <summary>Optional. UTC DateTime when the historyItem (activity session) was last understood as active or finished - if null, historyItem status should be Ongoing.</summary>
29+
/// <summary>Optional. UTC DateTime when the activityHistoryItem (activity session) was last understood as active or finished - if null, activityHistoryItem status should be Ongoing.</summary>
2430
public DateTimeOffset? LastActiveDateTime { get; set; }
2531
/// <summary>Set by the server. DateTime in UTC when the object was modified on the server.</summary>
2632
public DateTimeOffset? LastModifiedDateTime { get; set; }
27-
/// <summary>Required. UTC DateTime when the historyItem (activity session) was started. Required for timeline history.</summary>
33+
/// <summary>Required. UTC DateTime when the activityHistoryItem (activity session) was started. Required for timeline history.</summary>
2834
public DateTimeOffset? StartedDateTime { get; set; }
2935
/// <summary>The status property</summary>
30-
public ApiSdk.Models.Status? Status { get; set; }
36+
public global::ApiSdk.Models.Status? Status { get; set; }
3137
/// <summary>Optional. The timezone in which the user&apos;s device used to generate the activity was located at activity creation time. Values supplied as Olson IDs in order to support cross-platform representation.</summary>
3238
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
3339
#nullable enable
@@ -39,43 +45,50 @@ public class ActivityHistoryItem : Entity, IParsable {
3945
/// <summary>
4046
/// Creates a new instance of the appropriate class based on discriminator value
4147
/// </summary>
48+
/// <returns>A <see cref="global::ApiSdk.Models.ActivityHistoryItem"/></returns>
4249
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
43-
public static new ActivityHistoryItem CreateFromDiscriminatorValue(IParseNode parseNode) {
50+
public static new global::ApiSdk.Models.ActivityHistoryItem CreateFromDiscriminatorValue(IParseNode parseNode)
51+
{
4452
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
45-
return new ActivityHistoryItem();
53+
return new global::ApiSdk.Models.ActivityHistoryItem();
4654
}
4755
/// <summary>
4856
/// The deserialization information for the current model
4957
/// </summary>
50-
public new IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
51-
return new Dictionary<string, Action<IParseNode>>(base.GetFieldDeserializers()) {
52-
{"activeDurationSeconds", n => { ActiveDurationSeconds = n.GetIntValue(); } },
53-
{"activity", n => { Activity = n.GetObjectValue<UserActivity>(UserActivity.CreateFromDiscriminatorValue); } },
54-
{"createdDateTime", n => { CreatedDateTime = n.GetDateTimeOffsetValue(); } },
55-
{"expirationDateTime", n => { ExpirationDateTime = n.GetDateTimeOffsetValue(); } },
56-
{"lastActiveDateTime", n => { LastActiveDateTime = n.GetDateTimeOffsetValue(); } },
57-
{"lastModifiedDateTime", n => { LastModifiedDateTime = n.GetDateTimeOffsetValue(); } },
58-
{"startedDateTime", n => { StartedDateTime = n.GetDateTimeOffsetValue(); } },
59-
{"status", n => { Status = n.GetEnumValue<Status>(); } },
60-
{"userTimezone", n => { UserTimezone = n.GetStringValue(); } },
58+
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
59+
public override IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
60+
{
61+
return new Dictionary<string, Action<IParseNode>>(base.GetFieldDeserializers())
62+
{
63+
{ "activeDurationSeconds", n => { ActiveDurationSeconds = n.GetIntValue(); } },
64+
{ "activity", n => { Activity = n.GetObjectValue<global::ApiSdk.Models.UserActivity>(global::ApiSdk.Models.UserActivity.CreateFromDiscriminatorValue); } },
65+
{ "createdDateTime", n => { CreatedDateTime = n.GetDateTimeOffsetValue(); } },
66+
{ "expirationDateTime", n => { ExpirationDateTime = n.GetDateTimeOffsetValue(); } },
67+
{ "lastActiveDateTime", n => { LastActiveDateTime = n.GetDateTimeOffsetValue(); } },
68+
{ "lastModifiedDateTime", n => { LastModifiedDateTime = n.GetDateTimeOffsetValue(); } },
69+
{ "startedDateTime", n => { StartedDateTime = n.GetDateTimeOffsetValue(); } },
70+
{ "status", n => { Status = n.GetEnumValue<global::ApiSdk.Models.Status>(); } },
71+
{ "userTimezone", n => { UserTimezone = n.GetStringValue(); } },
6172
};
6273
}
6374
/// <summary>
6475
/// Serializes information the current object
6576
/// </summary>
6677
/// <param name="writer">Serialization writer to use to serialize this model</param>
67-
public new void Serialize(ISerializationWriter writer) {
78+
public override void Serialize(ISerializationWriter writer)
79+
{
6880
_ = writer ?? throw new ArgumentNullException(nameof(writer));
6981
base.Serialize(writer);
7082
writer.WriteIntValue("activeDurationSeconds", ActiveDurationSeconds);
71-
writer.WriteObjectValue<UserActivity>("activity", Activity);
83+
writer.WriteObjectValue<global::ApiSdk.Models.UserActivity>("activity", Activity);
7284
writer.WriteDateTimeOffsetValue("createdDateTime", CreatedDateTime);
7385
writer.WriteDateTimeOffsetValue("expirationDateTime", ExpirationDateTime);
7486
writer.WriteDateTimeOffsetValue("lastActiveDateTime", LastActiveDateTime);
7587
writer.WriteDateTimeOffsetValue("lastModifiedDateTime", LastModifiedDateTime);
7688
writer.WriteDateTimeOffsetValue("startedDateTime", StartedDateTime);
77-
writer.WriteEnumValue<Status>("status", Status);
89+
writer.WriteEnumValue<global::ApiSdk.Models.Status>("status", Status);
7890
writer.WriteStringValue("userTimezone", UserTimezone);
7991
}
8092
}
8193
}
94+
#pragma warning restore CS0618

0 commit comments

Comments
 (0)