Skip to content

Commit

Permalink
Merge pull request #4238 from microsoft/regen/clients-1698930298
Browse files Browse the repository at this point in the history
Regenerated API clients with Kiota
  • Loading branch information
baywet authored Nov 2, 2023
2 parents 332cb1e + 02b5bef commit 7a0cf72
Show file tree
Hide file tree
Showing 41 changed files with 236 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<De
UrlTemplate = UrlTemplate,
PathParameters = PathParameters,
};
requestInfo.Headers.Add("Accept", "application/json");
if (requestConfiguration != null) {
var requestConfig = new RequestConfiguration<DefaultQueryParameters>();
requestConfiguration.Invoke(requestConfig);
requestInfo.AddQueryParameters(requestConfig.QueryParameters);
requestInfo.AddRequestOptions(requestConfig.Options);
requestInfo.AddHeaders(requestConfig.Headers);
}
requestInfo.Headers.TryAdd("Accept", "application/json;q=1");
return requestInfo;
}
}
Expand Down
4 changes: 2 additions & 2 deletions get-started/azure-auth/cli/src/Client/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static User CreateFromDiscriminatorValue(IParseNode parseNode) {
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
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 @@ -51,7 +51,7 @@ public IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public 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
12 changes: 6 additions & 6 deletions get-started/azure-auth/cli/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/cli/../get-me.yml",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CLI",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public RequestInformation ToGetRequestInformation(Action<MeRequestBuilderGetRequ
UrlTemplate = UrlTemplate,
PathParameters = PathParameters,
};
requestInfo.Headers.Add("Accept", "application/json");
if (requestConfiguration != null) {
var requestConfig = new MeRequestBuilderGetRequestConfiguration();
requestConfiguration.Invoke(requestConfig);
requestInfo.AddRequestOptions(requestConfig.Options);
requestInfo.AddHeaders(requestConfig.Headers);
}
requestInfo.Headers.TryAdd("Accept", "application/json;q=1");
return requestInfo;
}
/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions get-started/azure-auth/dotnet/src/Client/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static User CreateFromDiscriminatorValue(IParseNode parseNode) {
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
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 @@ -51,7 +51,7 @@ public IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public 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
12 changes: 6 additions & 6 deletions get-started/azure-auth/dotnet/src/Client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/dotnet/../get-me.yml",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CSharp",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
12 changes: 6 additions & 6 deletions get-started/azure-auth/go/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/go/../get-me.yml",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "getuser/client",
"language": "Go",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
8 changes: 4 additions & 4 deletions get-started/azure-auth/go/client/me/me_request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func (m *MeRequestBuilder) Get(ctx context.Context, requestConfiguration *MeRequ
}
func (m *MeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *MeRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate
requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
requestInfo.Headers.Add("Accept", "application/json")
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate
requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
requestInfo.Headers.TryAdd("Accept", "application/json;q=1")
return requestInfo, nil
}
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/java/../get-me.yml",
"descriptionLocation": "../../../../../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "getuserclient.apiclient",
"language": "Java",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ public RequestInformation toGetRequestInformation() {
@jakarta.annotation.Nonnull
public RequestInformation toGetRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) {
final RequestInformation requestInfo = new RequestInformation();
requestInfo.httpMethod = HttpMethod.GET;
requestInfo.urlTemplate = urlTemplate;
requestInfo.pathParameters = pathParameters;
requestInfo.headers.add("Accept", "application/json");
if (requestConfiguration != null) {
final GetRequestConfiguration requestConfig = new GetRequestConfiguration();
requestConfiguration.accept(requestConfig);
requestInfo.headers.putAll(requestConfig.headers);
requestInfo.addRequestOptions(requestConfig.options);
}
requestInfo.httpMethod = HttpMethod.GET;
requestInfo.urlTemplate = urlTemplate;
requestInfo.pathParameters = pathParameters;
requestInfo.headers.tryAdd("Accept", "application/json;q=1");
return requestInfo;
}
/**
Expand Down
12 changes: 4 additions & 8 deletions get-started/azure-auth/php/client/Me/MeRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Exception;
use GetUser\Client\Models\User;
use Http\Promise\Promise;
use Http\Promise\RejectedPromise;
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
use Microsoft\Kiota\Abstractions\HttpMethod;
use Microsoft\Kiota\Abstractions\RequestAdapter;
Expand All @@ -32,15 +31,12 @@ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdap

/**
* @param MeRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise
* @return Promise<User|null>
* @throws Exception
*/
public function get(?MeRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
try {
return $this->requestAdapter->sendAsync($requestInfo, [User::class, 'createFromDiscriminatorValue'], null);
} catch(Exception $ex) {
return new RejectedPromise($ex);
}
return $this->requestAdapter->sendAsync($requestInfo, [User::class, 'createFromDiscriminatorValue'], null);
}

/**
Expand All @@ -52,11 +48,11 @@ public function toGetRequestInformation(?MeRequestBuilderGetRequestConfiguration
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::GET;
$requestInfo->addHeader('Accept', "application/json");
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json;q=1");
return $requestInfo;
}

Expand Down
12 changes: 6 additions & 6 deletions get-started/azure-auth/php/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/php/../get-me.yml",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "GetUser\\Client",
"language": "PHP",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
12 changes: 6 additions & 6 deletions get-started/azure-auth/python/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/python/../get-me.yml",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "client",
"language": "Python",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
8 changes: 4 additions & 4 deletions get-started/azure-auth/python/client/me/me_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ def to_get_request_information(self,request_configuration: Optional[MeRequestBui
Returns: RequestInformation
"""
request_info = RequestInformation()
if request_configuration:
request_info.headers.add_all(request_configuration.headers)
request_info.add_request_options(request_configuration.options)
request_info.url_template = self.url_template
request_info.path_parameters = self.path_parameters
request_info.http_method = Method.GET
request_info.headers["Accept"] = ["application/json"]
if request_configuration:
request_info.add_request_headers(request_configuration.headers)
request_info.add_request_options(request_configuration.options)
request_info.headers.try_add("Accept", "application/json;q=1")
return request_info

def with_url(self,raw_url: Optional[str] = None) -> MeRequestBuilder:
Expand Down
12 changes: 6 additions & 6 deletions get-started/azure-auth/ruby/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/ruby/../get-me.yml",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUser",
"language": "Ruby",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
8 changes: 4 additions & 4 deletions get-started/azure-auth/ruby/client/me/me_request_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ def get(request_configuration=nil)
end
def to_get_request_information(request_configuration=nil)
request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
request_info.url_template = @url_template
request_info.path_parameters = @path_parameters
request_info.http_method = :GET
request_info.headers.add('Accept', 'application/json')
unless request_configuration.nil?
request_info.add_headers_from_raw_object(request_configuration.headers)
request_info.add_request_options(request_configuration.options)
end
request_info.url_template = @url_template
request_info.path_parameters = @path_parameters
request_info.http_method = :GET
request_info.headers.try_add('Accept', 'application/json;q=1')
return request_info
end
##
Expand Down
12 changes: 6 additions & 6 deletions get-started/azure-auth/typescript/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "/home/runner/work/kiota-samples/kiota-samples/get-started/azure-auth/typescript/../get-me.yml",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.7.0",
"kiotaVersion": "1.8.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "ApiSdk",
"language": "TypeScript",
Expand All @@ -21,10 +21,10 @@
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
],
"structuredMimeTypes": [
"application/json",
"text/plain",
"application/x-www-form-urlencoded",
"multipart/form-data"
"application/json;q=1",
"text/plain;q=0.9",
"application/x-www-form-urlencoded;q=0.2",
"multipart/form-data;q=0.1"
],
"includePatterns": [],
"excludePatterns": [],
Expand Down
Loading

0 comments on commit 7a0cf72

Please sign in to comment.