Skip to content

Commit 99bb150

Browse files
Regenerated API clients with Kiota
1 parent 1445f3d commit 99bb150

20 files changed

Lines changed: 56 additions & 100 deletions

File tree

get-started/azure-auth/cli/src/Client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "GetUserClient.ApiClient",

get-started/azure-auth/dotnet/src/Client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "GetUserClient.ApiClient",

get-started/azure-auth/go/client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GraphApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "getuser/client",

get-started/azure-auth/java/app/src/main/java/getuserclient/apiclient/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../../../../../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "getuserclient.apiclient",

get-started/azure-auth/php/client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GraphApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "GetUser\\Client",

get-started/azure-auth/python/client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "client",

get-started/azure-auth/ruby/client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "GetUser",

get-started/azure-auth/typescript/client/getUserApiClient.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,23 @@ export function createGetUserApiClient(requestAdapter: RequestAdapter) {
2323
if (requestAdapter === undefined) {
2424
throw new Error("requestAdapter cannot be undefined");
2525
}
26-
let serializationWriterFactory : SerializationWriterFactoryRegistry
27-
let parseNodeFactoryRegistry : ParseNodeFactoryRegistry
26+
const serializationWriterFactory = requestAdapter.getSerializationWriterFactory() as SerializationWriterFactoryRegistry;
27+
const parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory() as ParseNodeFactoryRegistry;
28+
const backingStoreFactory = requestAdapter.getBackingStoreFactory();
2829

29-
if (requestAdapter.getParseNodeFactory() instanceof ParseNodeFactoryRegistry) {
30-
parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory() as ParseNodeFactoryRegistry
31-
} else {
32-
throw new Error("requestAdapter.getParseNodeFactory() is not a ParseNodeFactoryRegistry")
30+
if (parseNodeFactoryRegistry.registerDefaultDeserializer) {
31+
parseNodeFactoryRegistry.registerDefaultDeserializer(JsonParseNodeFactory, backingStoreFactory);
32+
parseNodeFactoryRegistry.registerDefaultDeserializer(TextParseNodeFactory, backingStoreFactory);
33+
parseNodeFactoryRegistry.registerDefaultDeserializer(FormParseNodeFactory, backingStoreFactory);
3334
}
3435

35-
if (requestAdapter.getSerializationWriterFactory() instanceof SerializationWriterFactoryRegistry) {
36-
serializationWriterFactory = requestAdapter.getSerializationWriterFactory() as SerializationWriterFactoryRegistry
37-
} else {
38-
throw new Error("requestAdapter.getSerializationWriterFactory() is not a SerializationWriterFactoryRegistry")
36+
if (serializationWriterFactory.registerDefaultSerializer) {
37+
serializationWriterFactory.registerDefaultSerializer(JsonSerializationWriterFactory);
38+
serializationWriterFactory.registerDefaultSerializer(TextSerializationWriterFactory);
39+
serializationWriterFactory.registerDefaultSerializer(FormSerializationWriterFactory);
40+
serializationWriterFactory.registerDefaultSerializer(MultipartSerializationWriterFactory);
3941
}
4042

41-
serializationWriterFactory.registerDefaultSerializer(JsonSerializationWriterFactory);
42-
serializationWriterFactory.registerDefaultSerializer(TextSerializationWriterFactory);
43-
serializationWriterFactory.registerDefaultSerializer(FormSerializationWriterFactory);
44-
serializationWriterFactory.registerDefaultSerializer(MultipartSerializationWriterFactory);
45-
46-
const backingStoreFactory = requestAdapter.getBackingStoreFactory();
47-
parseNodeFactoryRegistry.registerDefaultDeserializer(JsonParseNodeFactory, backingStoreFactory);
48-
parseNodeFactoryRegistry.registerDefaultDeserializer(TextParseNodeFactory, backingStoreFactory);
49-
parseNodeFactoryRegistry.registerDefaultDeserializer(FormParseNodeFactory, backingStoreFactory);
5043
if (requestAdapter.baseUrl === undefined || requestAdapter.baseUrl === null || requestAdapter.baseUrl === "") {
5144
requestAdapter.baseUrl = "https://graph.microsoft.com/v1.0";
5245
}

get-started/azure-auth/typescript/client/kiota-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"descriptionHash": "CC53A8DCDBBDD944A47CA25374E3BAACE62455AC8C7F8EAB047B09C8E02947E79C0CC2463CB961BFAA3E9A86A4AA3F5BEC74173882033721124777FA56212489",
2+
"descriptionHash": "4F9357A2611BE264CC88A04A51324A601C82B3AB985530CF30789DB42470344E1C0DF92172592119E9214C3438440B8009A09E7C0D89A086D580CA33051407BF",
33
"descriptionLocation": "../../get-me.yml",
44
"lockFileVersion": "1.0.0",
5-
"kiotaVersion": "1.26.1",
5+
"kiotaVersion": "1.27.0",
66
"clientClassName": "GetUserApiClient",
77
"typeAccessModifier": "Public",
88
"clientNamespaceName": "ApiSdk",

get-started/quickstart/cli/src/Client/Posts/Item/PostItemRequestBuilder.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,14 @@ public Command BuildDeleteCommand()
3131
{
3232
var command = new Command("delete");
3333
command.Description = "Delete post";
34-
var postIdOption = new Option<int?>("--post-id", description: "key: id of post") {
35-
};
36-
postIdOption.IsRequired = true;
37-
command.AddOption(postIdOption);
3834
var outputFileOption = new Option<FileInfo>("--output-file");
3935
command.AddOption(outputFileOption);
4036
command.SetHandler(async (invocationContext) => {
41-
var postId = invocationContext.ParseResult.GetValueForOption(postIdOption);
4237
var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption);
4338
var cancellationToken = invocationContext.GetCancellationToken();
4439
var reqAdapter = invocationContext.GetRequestAdapter();
4540
var requestInfo = ToDeleteRequestInformation(q => {
4641
});
47-
if (postId is not null) requestInfo.PathParameters.Add("post%2Did", postId);
4842
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: default, cancellationToken: cancellationToken) ?? Stream.Null;
4943
if (outputFile == null) {
5044
using var reader = new StreamReader(response);
@@ -67,16 +61,11 @@ public Command BuildGetCommand()
6761
{
6862
var command = new Command("get");
6963
command.Description = "Get post by ID";
70-
var postIdOption = new Option<int?>("--post-id", description: "key: id of post") {
71-
};
72-
postIdOption.IsRequired = true;
73-
command.AddOption(postIdOption);
7464
var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON);
7565
command.AddOption(outputOption);
7666
var queryOption = new Option<string>("--query");
7767
command.AddOption(queryOption);
7868
command.SetHandler(async (invocationContext) => {
79-
var postId = invocationContext.ParseResult.GetValueForOption(postIdOption);
8069
var output = invocationContext.ParseResult.GetValueForOption(outputOption);
8170
var query = invocationContext.ParseResult.GetValueForOption(queryOption);
8271
IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter");
@@ -85,7 +74,6 @@ public Command BuildGetCommand()
8574
var reqAdapter = invocationContext.GetRequestAdapter();
8675
var requestInfo = ToGetRequestInformation(q => {
8776
});
88-
if (postId is not null) requestInfo.PathParameters.Add("post%2Did", postId);
8977
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: default, cancellationToken: cancellationToken) ?? Stream.Null;
9078
response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response;
9179
var formatter = outputFormatterFactory.GetFormatter(output);
@@ -101,10 +89,6 @@ public Command BuildPatchCommand()
10189
{
10290
var command = new Command("patch");
10391
command.Description = "Update post";
104-
var postIdOption = new Option<int?>("--post-id", description: "key: id of post") {
105-
};
106-
postIdOption.IsRequired = true;
107-
command.AddOption(postIdOption);
10892
var bodyOption = new Option<string>("--body", description: "The request body") {
10993
};
11094
bodyOption.IsRequired = true;
@@ -114,7 +98,6 @@ public Command BuildPatchCommand()
11498
var queryOption = new Option<string>("--query");
11599
command.AddOption(queryOption);
116100
command.SetHandler(async (invocationContext) => {
117-
var postId = invocationContext.ParseResult.GetValueForOption(postIdOption);
118101
var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty;
119102
var output = invocationContext.ParseResult.GetValueForOption(outputOption);
120103
var query = invocationContext.ParseResult.GetValueForOption(queryOption);
@@ -131,7 +114,6 @@ public Command BuildPatchCommand()
131114
}
132115
var requestInfo = ToPatchRequestInformation(model, q => {
133116
});
134-
if (postId is not null) requestInfo.PathParameters.Add("post%2Did", postId);
135117
requestInfo.SetContentFromParsable(reqAdapter, "application/json", model);
136118
var response = await reqAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: default, cancellationToken: cancellationToken) ?? Stream.Null;
137119
response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response;

0 commit comments

Comments
 (0)