Skip to content

Commit

Permalink
Merge pull request #4944 from microsoft/regen/clients-1706879063
Browse files Browse the repository at this point in the history
Regenerated Kiota clients in get started projects
  • Loading branch information
jasonjoh authored Feb 2, 2024
2 parents 285a0f4 + 05cc66f commit 4c20d7b
Show file tree
Hide file tree
Showing 36 changed files with 252 additions and 218 deletions.
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.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CLI",
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.10.1",
"kiotaVersion": "1.11.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.10.1",
"kiotaVersion": "1.11.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.10.1",
"kiotaVersion": "1.11.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.10.1",
"kiotaVersion": "1.11.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.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "client",
"language": "Python",
Expand Down
4 changes: 2 additions & 2 deletions get-started/azure-auth/python/client/me/me_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class MeRequestBuilder(BaseRequestBuilder):
"""
Builds and executes requests for operations under /me
"""
def __init__(self,request_adapter: RequestAdapter, path_parameters: Optional[Union[Dict[str, Any], str]] = None) -> None:
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, Dict[str, Any]]) -> None:
"""
Instantiates a new MeRequestBuilder and sets the default values.
param path_parameters: The raw url or the Url template parameters for the request.
param path_parameters: The raw url or the url-template parameters for the request.
param request_adapter: The request adapter to use to execute the requests.
Returns: None
"""
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.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUser",
"language": "Ruby",
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
makesdk-dev.bat
*.js
out/
61 changes: 37 additions & 24 deletions get-started/azure-auth/typescript/client/getUserApiClient.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
/* tslint:disable */
/* eslint-disable */
// Generated by Microsoft Kiota
import { MeRequestBuilder } from './me/';
import { BaseRequestBuilder, enableBackingStoreForSerializationWriterFactory, ParseNodeFactoryRegistry, registerDefaultDeserializer, registerDefaultSerializer, SerializationWriterFactoryRegistry, type RequestAdapter } from '@microsoft/kiota-abstractions';
import { MeRequestBuilderRequestsMetadata, MeRequestBuilderUriTemplate, type MeRequestBuilder } from './me/';
import { apiClientProxifier, registerDefaultDeserializer, registerDefaultSerializer, type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
import { FormParseNodeFactory, FormSerializationWriterFactory } from '@microsoft/kiota-serialization-form';
import { JsonParseNodeFactory, JsonSerializationWriterFactory } from '@microsoft/kiota-serialization-json';
import { MultipartSerializationWriterFactory } from '@microsoft/kiota-serialization-multipart';
import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft/kiota-serialization-text';

/**
* Instantiates a new GetUserApiClient and sets the default values.
* @param requestAdapter The request adapter to use to execute the requests.
*/
export function createGetUserApiClient(requestAdapter: RequestAdapter) {
registerDefaultSerializer(JsonSerializationWriterFactory);
registerDefaultSerializer(TextSerializationWriterFactory);
registerDefaultSerializer(FormSerializationWriterFactory);
registerDefaultSerializer(MultipartSerializationWriterFactory);
registerDefaultDeserializer(JsonParseNodeFactory);
registerDefaultDeserializer(TextParseNodeFactory);
registerDefaultDeserializer(FormParseNodeFactory);
if (requestAdapter.baseUrl === undefined || requestAdapter.baseUrl === "") {
requestAdapter.baseUrl = "https://graph.microsoft.com/v1.0";
}
const pathParameters: Record<string, unknown> = {
"baseurl": requestAdapter.baseUrl,
};
return apiClientProxifier<GetUserApiClient>(requestAdapter, pathParameters, GetUserApiClientUriTemplate, GetUserApiClientNavigationMetadata, undefined);
}
/**
* The main entry point of the SDK, exposes the configuration and the fluent API.
*/
export class GetUserApiClient extends BaseRequestBuilder<GetUserApiClient> {
export interface GetUserApiClient extends BaseRequestBuilder<GetUserApiClient> {
/**
* The me property
*/
public get me(): MeRequestBuilder {
return new MeRequestBuilder(this.pathParameters, this.requestAdapter);
}
/**
* Instantiates a new GetUserApiClient and sets the default values.
* @param requestAdapter The request adapter to use to execute the requests.
*/
public constructor(requestAdapter: RequestAdapter) {
super({}, requestAdapter, "{+baseurl}", (x, y) => new GetUserApiClient(y));
registerDefaultSerializer(JsonSerializationWriterFactory);
registerDefaultSerializer(TextSerializationWriterFactory);
registerDefaultSerializer(FormSerializationWriterFactory);
registerDefaultSerializer(MultipartSerializationWriterFactory);
registerDefaultDeserializer(JsonParseNodeFactory);
registerDefaultDeserializer(TextParseNodeFactory);
registerDefaultDeserializer(FormParseNodeFactory);
if (requestAdapter.baseUrl === undefined || requestAdapter.baseUrl === "") {
requestAdapter.baseUrl = "https://graph.microsoft.com/v1.0";
}
this.pathParameters["baseurl"] = requestAdapter.baseUrl;
}
get me(): MeRequestBuilder;
}
/**
* Metadata for all the navigation properties in the request builder.
*/
export const GetUserApiClientNavigationMetadata: Record<Exclude<keyof GetUserApiClient, KeysToExcludeForNavigationMetadata>, NavigationMetadata> = {
me: {
uriTemplate: MeRequestBuilderUriTemplate,
requestsMetadata: MeRequestBuilderRequestsMetadata,
},
};
/**
* Uri template for the request builder.
*/
export const GetUserApiClientUriTemplate = "{+baseurl}";
/* tslint:enable */
/* eslint-enable */
2 changes: 1 addition & 1 deletion get-started/azure-auth/typescript/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.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "ApiSdk",
"language": "TypeScript",
Expand Down
40 changes: 18 additions & 22 deletions get-started/azure-auth/typescript/client/me/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,36 @@
/* eslint-disable */
// Generated by Microsoft Kiota
import { createUserFromDiscriminatorValue, type User } from '../models/';
import { BaseRequestBuilder, HttpMethod, RequestInformation, type Parsable, type ParsableFactory, type RequestAdapter, type RequestConfiguration, type RequestOption } from '@microsoft/kiota-abstractions';
import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';

/**
* Builds and executes requests for operations under /me
*/
export class MeRequestBuilder extends BaseRequestBuilder<MeRequestBuilder> {
/**
* Instantiates a new MeRequestBuilder and sets the default values.
* @param pathParameters The raw url or the Url template parameters for the request.
* @param requestAdapter The request adapter to use to execute the requests.
*/
public constructor(pathParameters: Record<string, unknown> | string | undefined, requestAdapter: RequestAdapter) {
super(pathParameters, requestAdapter, "{+baseurl}/me", (x, y) => new MeRequestBuilder(x, y));
}
export interface MeRequestBuilder extends BaseRequestBuilder<MeRequestBuilder> {
/**
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a Promise of User
*/
public get(requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<User | undefined> {
const requestInfo = this.toGetRequestInformation(
requestConfiguration
);
return this.requestAdapter.sendAsync<User>(requestInfo, createUserFromDiscriminatorValue, undefined);
}
get(requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<User | undefined>;
/**
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation {
const requestInfo = new RequestInformation(HttpMethod.GET, this.urlTemplate, this.pathParameters);
requestInfo.configure(requestConfiguration);
requestInfo.headers.tryAdd("Accept", "application/json");
return requestInfo;
}
toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
}
/**
* Metadata for all the requests in the request builder.
*/
export const MeRequestBuilderRequestsMetadata: RequestsMetadata = {
get: {
responseBodyContentType: "application/json",
adapterMethodName: "sendAsync",
responseBodyFactory: createUserFromDiscriminatorValue,
},
};
/**
* Uri template for the request builder.
*/
export const MeRequestBuilderUriTemplate = "{+baseurl}/me";
/* tslint:enable */
/* eslint-enable */
19 changes: 16 additions & 3 deletions get-started/azure-auth/typescript/client/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@
// Generated by Microsoft Kiota
import { type AdditionalDataHolder, type Parsable, type ParseNode, type SerializationWriter } from '@microsoft/kiota-abstractions';

export function createUserFromDiscriminatorValue(parseNode: ParseNode | undefined) {
/**
* Creates a new instance of the appropriate class based on discriminator value
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a user
*/
export function createUserFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoUser;
}
export function deserializeIntoUser(user: User | undefined = {} as User) : Record<string, (node: ParseNode) => void> {
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoUser(user: Partial<User> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"displayName": n => { user.displayName = n.getStringValue(); },
"id": n => { user.id = n.getStringValue(); },
}
}
export function serializeUser(writer: SerializationWriter, user: User | undefined = {} as User) : void {
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeUser(writer: SerializationWriter, user: Partial<User> | undefined = {}) : void {
writer.writeStringValue("displayName", user.displayName);
writer.writeStringValue("id", user.id);
writer.writeAdditionalData(user.additionalData);
Expand Down
4 changes: 2 additions & 2 deletions get-started/azure-auth/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { DeviceCodeCredential } from '@azure/identity';
import { AzureIdentityAuthenticationProvider } from '@microsoft/kiota-authentication-azure';
import { FetchRequestAdapter } from '@microsoft/kiota-http-fetchlibrary';
import { GetUserApiClient } from './client/getUserApiClient';
import { createGetUserApiClient } from './client/getUserApiClient';

const clientId = 'YOUR_CLIENT_ID';

Expand All @@ -25,7 +25,7 @@ const authProvider =
new AzureIdentityAuthenticationProvider(credential, graphScopes, undefined, allowedHosts);
const adapter = new FetchRequestAdapter(authProvider);

const client = new GetUserApiClient(adapter);
const client = createGetUserApiClient(adapter);

async function GetUser(): Promise<void> {
try {
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./out", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public Command BuildListCommand() {
/// Instantiates a new PostsRequestBuilder and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
public PostsRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/posts{?userId*,title*}", pathParameters) {
public PostsRequestBuilder(Dictionary<string, object> pathParameters) : base("{+baseurl}/posts{?title*,userId*}", pathParameters) {
}
/// <summary>
/// Instantiates a new PostsRequestBuilder and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public PostsRequestBuilder(string rawUrl) : base("{+baseurl}/posts{?userId*,title*}", rawUrl) {
public PostsRequestBuilder(string rawUrl) : base("{+baseurl}/posts{?title*,userId*}", rawUrl) {
}
/// <summary>
/// Get posts
Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/cli/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "KiotaPostsCLI.Client",
"language": "CLI",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public PostItemRequestBuilder this[string position] { get {
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public PostsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/posts{?userId*,title*}", pathParameters) {
public PostsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/posts{?title*,userId*}", pathParameters) {
}
/// <summary>
/// Instantiates a new PostsRequestBuilder 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 PostsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/posts{?userId*,title*}", rawUrl) {
public PostsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/posts{?title*,userId*}", rawUrl) {
}
/// <summary>
/// Get posts
Expand Down
2 changes: 1 addition & 1 deletion get-started/quickstart/dotnet/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "KiotaPosts.Client",
"language": "CSharp",
Expand Down
4 changes: 2 additions & 2 deletions get-started/quickstart/dotnet/src/KiotaPosts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.7.6" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.3.4" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.7.8" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.3.5" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.1.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.1.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.1.1" />
Expand Down
2 changes: 0 additions & 2 deletions get-started/quickstart/dotnet/test/KiotaPostsTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.7.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.1.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.6.6" />
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
Expand Up @@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.10.1",
"kiotaVersion": "1.11.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "kiota_posts/client",
"language": "Go",
Expand Down
Loading

0 comments on commit 4c20d7b

Please sign in to comment.