Skip to content

Commit

Permalink
Regenerated API clients with Kiota
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 15, 2024
1 parent 2c83a92 commit 561239e
Show file tree
Hide file tree
Showing 36 changed files with 280 additions and 139 deletions.
12 changes: 8 additions & 4 deletions get-started/azure-auth/cli/src/Client/GetUserApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ namespace GetUserClient.ApiClient {
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
public class GetUserApiClient : BaseCliRequestBuilder {
public class GetUserApiClient : BaseCliRequestBuilder
{
/// <summary>
/// The me property
/// </summary>
/// <returns>A <see cref="Command"/></returns>
public Command BuildMeNavCommand() {
public Command BuildMeNavCommand()
{
var command = new Command("me");
command.Description = "The me property";
var builder = new MeRequestBuilder(PathParameters);
Expand All @@ -40,7 +42,8 @@ public Command BuildMeNavCommand() {
/// Instantiates a new <see cref="GetUserApiClient"/> and sets the default values.
/// </summary>
/// <returns>A <see cref="Command"/></returns>
public Command BuildRootCommand() {
public Command BuildRootCommand()
{
var command = new RootCommand();
command.Description = "Instantiates a new GetUserApiClient and sets the default values.";
command.AddCommand(BuildMeNavCommand());
Expand All @@ -49,7 +52,8 @@ public Command BuildRootCommand() {
/// <summary>
/// Instantiates a new <see cref="GetUserApiClient"/> and sets the default values.
/// </summary>
public GetUserApiClient() : base("{+baseurl}", new Dictionary<string, object>()) {
public GetUserApiClient() : base("{+baseurl}", new Dictionary<string, object>())
{
}
}
}
18 changes: 12 additions & 6 deletions get-started/azure-auth/cli/src/Client/Me/MeRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ namespace GetUserClient.ApiClient.Me {
/// <summary>
/// Builds and executes requests for operations under \me
/// </summary>
public class MeRequestBuilder : BaseCliRequestBuilder {
public class MeRequestBuilder : BaseCliRequestBuilder
{
/// <returns>A <see cref="Command"/></returns>
public Command BuildGetCommand() {
public Command BuildGetCommand()
{
var command = new Command("get");
var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON);
command.AddOption(outputOption);
Expand All @@ -45,22 +47,26 @@ public Command BuildGetCommand() {
/// Instantiates a new <see cref="MeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
public MeRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/me", pathParameters) {
public MeRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/me", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="MeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public MeRequestBuilder(string rawUrl) : base("{+baseurl}/me", rawUrl) {
public MeRequestBuilder(string rawUrl) : base("{+baseurl}/me", rawUrl)
{
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) {
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
Expand Down
18 changes: 12 additions & 6 deletions get-started/azure-auth/cli/src/Client/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
using System.Linq;
using System;
namespace GetUserClient.ApiClient.Models {
public class User : IAdditionalDataHolder, IParsable {
public class User : IAdditionalDataHolder, IParsable
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The displayName property</summary>
Expand All @@ -27,24 +28,28 @@ public class User : IAdditionalDataHolder, IParsable {
/// <summary>
/// Instantiates a new <see cref="User"/> and sets the default values.
/// </summary>
public User() {
public User()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="User"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static User CreateFromDiscriminatorValue(IParseNode parseNode) {
public static User CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new User();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
return new Dictionary<string, Action<IParseNode>> {
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"displayName", n => { DisplayName = n.GetStringValue(); } },
{"id", n => { Id = n.GetStringValue(); } },
};
Expand All @@ -53,7 +58,8 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer) {
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("displayName", DisplayName);
writer.WriteStringValue("id", Id);
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/cli/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CLI",
Expand Down
14 changes: 9 additions & 5 deletions get-started/azure-auth/dotnet/src/Client/GetUserApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,28 @@ namespace GetUserClient.ApiClient {
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
public class GetUserApiClient : BaseRequestBuilder {
public class GetUserApiClient : BaseRequestBuilder
{
/// <summary>The me property</summary>
public MeRequestBuilder Me { get =>
new MeRequestBuilder(PathParameters, RequestAdapter);
public MeRequestBuilder Me
{
get => new MeRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>
/// Instantiates a new <see cref="GetUserApiClient"/> and sets the default values.
/// </summary>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public GetUserApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary<string, object>()) {
public GetUserApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary<string, object>())
{
ApiClientBuilder.RegisterDefaultSerializer<JsonSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<TextSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<FormSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<MultipartSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<JsonParseNodeFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<TextParseNodeFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) {
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl))
{
RequestAdapter.BaseUrl = "https://graph.microsoft.com/v1.0";
}
PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
Expand Down
27 changes: 18 additions & 9 deletions get-started/azure-auth/dotnet/src/Client/Me/MeRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,35 @@ namespace GetUserClient.ApiClient.Me {
/// <summary>
/// Builds and executes requests for operations under \me
/// </summary>
public class MeRequestBuilder : BaseRequestBuilder {
public class MeRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="MeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public MeRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/me", pathParameters) {
public MeRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/me", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="MeRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public MeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/me", rawUrl) {
public MeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/me", rawUrl)
{
}
/// <returns>A <see cref="User"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<User?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) {
public async Task<User?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<User> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) {
public async Task<User> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
return await RequestAdapter.SendAsync<User>(requestInfo, User.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
Expand All @@ -44,10 +49,12 @@ public async Task<User> GetAsync(Action<RequestConfiguration<DefaultQueryParamet
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) {
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
Expand All @@ -59,14 +66,16 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<De
/// </summary>
/// <returns>A <see cref="MeRequestBuilder"/></returns>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public MeRequestBuilder WithUrl(string rawUrl) {
public MeRequestBuilder WithUrl(string rawUrl)
{
return new MeRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// Configuration for the request such as headers, query parameters, and middleware options.
/// </summary>
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
public class MeRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters> {
public class MeRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}
}
}
18 changes: 12 additions & 6 deletions get-started/azure-auth/dotnet/src/Client/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
using System.Linq;
using System;
namespace GetUserClient.ApiClient.Models {
public class User : IAdditionalDataHolder, IParsable {
public class User : IAdditionalDataHolder, IParsable
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The displayName property</summary>
Expand All @@ -27,24 +28,28 @@ public class User : IAdditionalDataHolder, IParsable {
/// <summary>
/// Instantiates a new <see cref="User"/> and sets the default values.
/// </summary>
public User() {
public User()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="User"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static User CreateFromDiscriminatorValue(IParseNode parseNode) {
public static User CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new User();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
return new Dictionary<string, Action<IParseNode>> {
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"displayName", n => { DisplayName = n.GetStringValue(); } },
{"id", n => { Id = n.GetStringValue(); } },
};
Expand All @@ -53,7 +58,8 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer) {
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("displayName", DisplayName);
writer.WriteStringValue("id", Id);
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/dotnet/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CSharp",
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/go/client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "getuser/client",
"language": "Go",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../../../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "getuserclient.apiclient",
"language": "Java",
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/php/client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "GetUser\\Client",
"language": "PHP",
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/python/client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "client",
"language": "Python",
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/ruby/client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.12.0",
"kiotaVersion": "1.13.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUser",
"language": "Ruby",
Expand Down
Loading

0 comments on commit 561239e

Please sign in to comment.