Skip to content

Commit

Permalink
Fixes for new Kiota dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjoh committed Aug 9, 2023
1 parent d61c7a4 commit f85c6d9
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 23 deletions.
3 changes: 2 additions & 1 deletion get-started/azure-auth/cli/src/GetUserClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.3.0" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.0.3" />
<PackageReference Include="Microsoft.Kiota.Cli.Commons" Version="0.2.1-preview.1" />
<PackageReference Include="Microsoft.Kiota.Cli.Commons" Version="0.3.1-preview.1" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.0.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.0.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.0.8" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.0.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.0.3" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions get-started/azure-auth/dotnet/src/GetUserClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.0.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.0.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.0.8" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.0.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.0.3" />
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 1 addition & 0 deletions get-started/azure-auth/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/microsoft/kiota-http-go v1.0.1
github.com/microsoft/kiota-serialization-form-go v1.0.0
github.com/microsoft/kiota-serialization-json-go v1.0.4
github.com/microsoft/kiota-serialization-multipart-go v1.0.0
github.com/microsoft/kiota-serialization-text-go v1.0.0
)

Expand Down
2 changes: 2 additions & 0 deletions get-started/azure-auth/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjb
github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA=
github.com/microsoft/kiota-serialization-json-go v1.0.4 h1:5TaISWwd2Me8clrK7SqNATo0tv9seOq59y4I5953egQ=
github.com/microsoft/kiota-serialization-json-go v1.0.4/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so=
github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA=
github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
Expand Down
1 change: 1 addition & 0 deletions get-started/azure-auth/java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:0.5.0'
implementation 'com.azure:azure-identity:1.9.2'
// </DependenciesSnippet>
}
Expand Down
23 changes: 22 additions & 1 deletion get-started/azure-auth/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion get-started/azure-auth/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
},
"dependencies": {
"@azure/identity": "^3.2.4",
"@microsoft/kiota-abstractions": "^1.0.0-preview.24",
"@microsoft/kiota-abstractions": "^1.0.0-preview.26",
"@microsoft/kiota-authentication-azure": "^1.0.0-preview.21",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.25",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.15",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.24",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.3",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.23",
"node-fetch": "^3.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/cli/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"program": "${workspaceFolder}/src/bin/Debug/net7.0/KiotaPostsCLI.dll",
"args": [
"posts",
"item",
"patch",
"--post-id",
"5",
Expand All @@ -23,6 +22,7 @@
"cwd": "${workspaceFolder}/src",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"stopAtEntry": false
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace KiotaPostsCLI.Client.Posts {
/// </summary>
public class PostsRequestBuilder : BaseCliRequestBuilder {
/// <summary>Gets an item from the KiotaPostsCLI.Client.posts.item collection</summary>
[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
public PostItemRequestBuilder this[string position] { get {
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("post%2Did", position);
} }
// [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
// public PostItemRequestBuilder this[string position] { get {
// var urlTplParams = new Dictionary<string, object>(PathParameters);
// if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("post%2Did", position);
// } }
/// <summary>
/// Gets an item from the KiotaPostsCLI.Client.posts.item collection
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion get-started/quickstart/cli/src/KiotaPostsCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.3.0" />
<PackageReference Include="Microsoft.Kiota.Cli.Commons" Version="0.2.1-preview.1" />
<PackageReference Include="Microsoft.Kiota.Cli.Commons" Version="0.3.1-preview.1" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.0.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.0.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.0.8" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.0.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.0.3" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions get-started/quickstart/dotnet/src/KiotaPosts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.0.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.0.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.0.8" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.0.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.0.3" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/dotnet/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Console.WriteLine($"Retrieved {allPosts?.Count} posts.");

// GET /posts/{id}
var specificPostId = "5";
var specificPostId = 5;
var specificPost = await client.Posts[specificPostId].GetAsync();
Console.WriteLine($"Retrieved post - ID: {specificPost?.Id}, Title: {specificPost?.Title}, Body: {specificPost?.Body}");

Expand Down
4 changes: 2 additions & 2 deletions get-started/quickstart/dotnet/test/PostsRequestsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public async Task Post_By_Id()
.Returns(postsMock[1]);

// Act
var post1 = await postsClient.Posts["1"].GetAsync();
var post2 = await postsClient.Posts["2"].GetAsync();
var post1 = await postsClient.Posts[1].GetAsync();
var post2 = await postsClient.Posts[2].GetAsync();

// Assert
Assert.NotNull(post1);
Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/go/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/quickstart/go/../posts-api.yml",
"descriptionLocation": "C:\\Source\\Repos\\kiota-samples\\get-started\\quickstart\\go\\..\\posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.5.0",
"clientClassName": "PostsClient",
Expand Down
1 change: 1 addition & 0 deletions get-started/quickstart/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/microsoft/kiota-http-go v1.0.1
github.com/microsoft/kiota-serialization-form-go v1.0.0
github.com/microsoft/kiota-serialization-json-go v1.0.4
github.com/microsoft/kiota-serialization-multipart-go v1.0.0
github.com/microsoft/kiota-serialization-text-go v1.0.0
)

Expand Down
2 changes: 2 additions & 0 deletions get-started/quickstart/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjb
github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA=
github.com/microsoft/kiota-serialization-json-go v1.0.4 h1:5TaISWwd2Me8clrK7SqNATo0tv9seOq59y4I5953egQ=
github.com/microsoft/kiota-serialization-json-go v1.0.4/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so=
github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA=
github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
8 changes: 4 additions & 4 deletions get-started/quickstart/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func main() {
fmt.Printf("Retrieved %d posts.\n", len(allPosts))

// GET /posts/{id}
specificPostId := "5"
specificPost, err := client.Posts().ByPostId(specificPostId).Get(context.Background(), nil)
specificPostId := int32(5)
specificPost, err := client.Posts().ByPostIdInteger(specificPostId).Get(context.Background(), nil)
if err != nil {
log.Fatalf("Error getting post by ID: %v\n", err)
}
Expand All @@ -65,14 +65,14 @@ func main() {
newTitle := "Updated title"
update.SetTitle(&newTitle)

updatedPost, err := client.Posts().ByPostId(specificPostId).Patch(context.Background(), update, nil)
updatedPost, err := client.Posts().ByPostIdInteger(specificPostId).Patch(context.Background(), update, nil)
if err != nil {
log.Fatalf("Error updating post: %v\n", err)
}
fmt.Printf("Updated post - ID: %d, Title: %s, Body: %s\n", *updatedPost.GetId(), *updatedPost.GetTitle(), *updatedPost.GetBody())

// DELETE /posts/{id}
_, err = client.Posts().ByPostId(specificPostId).Delete(context.Background(), nil)
_, err = client.Posts().ByPostIdInteger(specificPostId).Delete(context.Background(), nil)
if err != nil {
log.Fatalf("Error deleting post: %v\n", err)
}
Expand Down
1 change: 1 addition & 0 deletions get-started/quickstart/java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:0.5.0'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:0.5.0'
// </DependenciesSnippet>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void main(String[] args) {
.join();

// GET /posts/{id}
final String specificPostId = "5";
final Integer specificPostId = 5;
client.posts().byPostId(specificPostId).get()
.thenAccept(specificPost -> {
System.out.printf("Retrieved post - ID: %d, Title: %s, Body: %s%n",
Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/php/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
echo "Retrieved {$postCount} posts.\n";

// GET /posts/{id}
$specificPostId = "5";
$specificPostId = 5;
$specificPost = $client->posts()->byPostId($specificPostId)->get()->wait();
echo "Retrieved post - ID: {$specificPost->getId()}, Title: {$specificPost->getTitle()}, Body: {$specificPost->getBody()}\n";

Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function main(): Promise<void> {
console.log(`Retrieved ${allPosts?.length} posts.`);

// GET /posts/{id}
const specificPostId = '5';
const specificPostId = 5;
const specificPost = await client.posts.byPostId(specificPostId).get();
console.log(`Retrieved post - ID: ${specificPost?.id}, Title: ${specificPost?.title}, Body: ${specificPost?.body}`);

Expand Down
13 changes: 12 additions & 1 deletion get-started/quickstart/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion get-started/quickstart/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"author": "",
"license": "MIT",
"dependencies": {
"@microsoft/kiota-abstractions": "^1.0.0-preview.22",
"@microsoft/kiota-abstractions": "^1.0.0-preview.26",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.25",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.15",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.24",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.3",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.23"
},
"devDependencies": {
Expand Down

0 comments on commit f85c6d9

Please sign in to comment.