Merge pull request #6228 from microsoft/regen/clients-1723468054

Regenerated API clients with Kiota
This commit is contained in:
Vincent Biret 2024-08-12 09:11:07 -04:00 коммит произвёл GitHub
Родитель 2822bcc4ff b3c07e7d30
Коммит d89c3fa8e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
40 изменённых файлов: 60 добавлений и 52 удалений

Просмотреть файл

@ -19,7 +19,7 @@ namespace GetUserClient.ApiClient
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class GetUserApiClient : BaseCliRequestBuilder
{
/// <summary>

Просмотреть файл

@ -18,7 +18,7 @@ namespace GetUserClient.ApiClient.Me
/// <summary>
/// Builds and executes requests for operations under \me
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class MeRequestBuilder : BaseCliRequestBuilder
{
/// <returns>A <see cref="Command"/></returns>

Просмотреть файл

@ -6,7 +6,7 @@ using System.IO;
using System;
namespace GetUserClient.ApiClient.Models
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
#pragma warning disable CS1591
public partial class User : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CLI",

Просмотреть файл

@ -15,7 +15,7 @@ namespace GetUserClient.ApiClient
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class GetUserApiClient : BaseRequestBuilder
{
/// <summary>The me property</summary>

Просмотреть файл

@ -13,7 +13,7 @@ namespace GetUserClient.ApiClient.Me
/// <summary>
/// Builds and executes requests for operations under \me
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class MeRequestBuilder : BaseRequestBuilder
{
/// <summary>
@ -76,7 +76,7 @@ namespace GetUserClient.ApiClient.Me
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class MeRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}

Просмотреть файл

@ -6,7 +6,7 @@ using System.IO;
using System;
namespace GetUserClient.ApiClient.Models
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
#pragma warning disable CS1591
public partial class User : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUserClient.ApiClient",
"language": "CSharp",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "getuser/client",
"language": "Go",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../../../../../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "getuserclient.apiclient",
"language": "Java",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GraphApiClient",
"clientNamespaceName": "GetUser\\Client",
"language": "PHP",

Просмотреть файл

@ -26,7 +26,7 @@ class GetUserApiClient(BaseRequestBuilder):
param request_adapter: The request adapter to use to execute the requests.
Returns: None
"""
if not request_adapter:
if request_adapter is None:
raise TypeError("request_adapter cannot be null.")
super().__init__(request_adapter, "{+baseurl}", None)
register_default_serializer(JsonSerializationWriterFactory)

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "client",
"language": "Python",

Просмотреть файл

@ -58,7 +58,7 @@ class MeRequestBuilder(BaseRequestBuilder):
param raw_url: The raw URL to use for the request builder.
Returns: MeRequestBuilder
"""
if not raw_url:
if raw_url is None:
raise TypeError("raw_url cannot be null.")
return MeRequestBuilder(self.request_adapter, raw_url)

Просмотреть файл

@ -20,7 +20,7 @@ class User(AdditionalDataHolder, Parsable):
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: User
"""
if not parse_node:
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return User()
@ -41,7 +41,7 @@ class User(AdditionalDataHolder, Parsable):
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if not writer:
if writer is None:
raise TypeError("writer cannot be null.")
writer.write_str_value("displayName", self.display_name)
writer.write_str_value("id", self.id)

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "GetUser",
"language": "Ruby",

Просмотреть файл

@ -18,6 +18,7 @@ import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft
* Instantiates a new {@link GetUserApiClient} and sets the default values.
* @param requestAdapter The request adapter to use to execute the requests.
*/
// @ts-ignore
export function createGetUserApiClient(requestAdapter: RequestAdapter) {
registerDefaultSerializer(JsonSerializationWriterFactory);
registerDefaultSerializer(TextSerializationWriterFactory);

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "126B1DCD90D419BD411E85DB2452D7D395405237ACF715ECB02992FB92848451D51D4254758E106D7281F10FCEA55629636227F3DC5AFB2550A04CB944BD6EE1",
"descriptionLocation": "../../get-me.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "GetUserApiClient",
"clientNamespaceName": "ApiSdk",
"language": "TypeScript",

Просмотреть файл

@ -9,6 +9,7 @@ import { type AdditionalDataHolder, type Parsable, type ParseNode, type Serializ
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns {User}
*/
// @ts-ignore
export function createUserFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoUser;
}
@ -16,6 +17,7 @@ export function createUserFromDiscriminatorValue(parseNode: ParseNode | undefine
* The deserialization information for the current model
* @returns {Record<string, (node: ParseNode) => void>}
*/
// @ts-ignore
export function deserializeIntoUser(user: Partial<User> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"displayName": n => { user.displayName = n.getStringValue(); },
@ -26,6 +28,7 @@ export function deserializeIntoUser(user: Partial<User> | undefined = {}) : Reco
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
// @ts-ignore
export function serializeUser(writer: SerializationWriter, user: Partial<User> | undefined = {}) : void {
writer.writeStringValue("displayName", user.displayName);
writer.writeStringValue("id", user.id);

Просмотреть файл

@ -6,7 +6,7 @@ using System.IO;
using System;
namespace KiotaPostsCLI.Client.Models
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
#pragma warning disable CS1591
public partial class Post : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591

Просмотреть файл

@ -18,7 +18,7 @@ namespace KiotaPostsCLI.Client.Posts.Item
/// <summary>
/// Builds and executes requests for operations under \posts\{post-id}
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostItemRequestBuilder : BaseCliRequestBuilder
{
/// <summary>

Просмотреть файл

@ -19,7 +19,7 @@ namespace KiotaPostsCLI.Client.Posts
/// <summary>
/// Builds and executes requests for operations under \posts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilder : BaseCliRequestBuilder
{
/// <summary>
@ -173,7 +173,7 @@ namespace KiotaPostsCLI.Client.Posts
/// <summary>
/// Get posts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilderGetQueryParameters
{
/// <summary>Filter results by title</summary>

Просмотреть файл

@ -19,7 +19,7 @@ namespace KiotaPostsCLI.Client
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsClient : BaseCliRequestBuilder
{
/// <summary>

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "KiotaPostsCLI.Client",
"language": "CLI",

Просмотреть файл

@ -6,7 +6,7 @@ using System.IO;
using System;
namespace KiotaPosts.Client.Models
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
#pragma warning disable CS1591
public partial class Post : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591

Просмотреть файл

@ -13,7 +13,7 @@ namespace KiotaPosts.Client.Posts.Item
/// <summary>
/// Builds and executes requests for operations under \posts\{post-id}
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostItemRequestBuilder : BaseRequestBuilder
{
/// <summary>
@ -160,7 +160,7 @@ namespace KiotaPosts.Client.Posts.Item
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}
@ -168,7 +168,7 @@ namespace KiotaPosts.Client.Posts.Item
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostItemRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}
@ -176,7 +176,7 @@ namespace KiotaPosts.Client.Posts.Item
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostItemRequestBuilderPatchRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}

Просмотреть файл

@ -14,7 +14,7 @@ namespace KiotaPosts.Client.Posts
/// <summary>
/// Builds and executes requests for operations under \posts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the KiotaPosts.Client.posts.item collection</summary>
@ -150,7 +150,7 @@ namespace KiotaPosts.Client.Posts
/// <summary>
/// Get posts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilderGetQueryParameters
{
/// <summary>Filter results by title</summary>
@ -171,7 +171,7 @@ namespace KiotaPosts.Client.Posts
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilderGetRequestConfiguration : RequestConfiguration<global::KiotaPosts.Client.Posts.PostsRequestBuilder.PostsRequestBuilderGetQueryParameters>
{
}
@ -179,7 +179,7 @@ namespace KiotaPosts.Client.Posts
/// 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.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsRequestBuilderPostRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
{
}

Просмотреть файл

@ -15,7 +15,7 @@ namespace KiotaPosts.Client
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.17.0")]
public partial class PostsClient : BaseRequestBuilder
{
/// <summary>The posts property</summary>

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "KiotaPosts.Client",
"language": "CSharp",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "kiota_posts/client",
"language": "Go",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../../../../../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "kiotaposts.client",
"language": "Java",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsApiClient",
"clientNamespaceName": "KiotaPosts\\Client",
"language": "PHP",

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "client",
"language": "Python",

Просмотреть файл

@ -24,7 +24,7 @@ class Post(AdditionalDataHolder, Parsable):
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: Post
"""
if not parse_node:
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return Post()
@ -47,7 +47,7 @@ class Post(AdditionalDataHolder, Parsable):
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if not writer:
if writer is None:
raise TypeError("writer cannot be null.")
writer.write_str_value("body", self.body)
writer.write_int_value("id", self.id)

Просмотреть файл

@ -63,7 +63,7 @@ class PostItemRequestBuilder(BaseRequestBuilder):
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[Post]
"""
if not body:
if body is None:
raise TypeError("body cannot be null.")
request_info = self.to_patch_request_information(
body, request_configuration
@ -102,7 +102,7 @@ class PostItemRequestBuilder(BaseRequestBuilder):
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
if not body:
if body is None:
raise TypeError("body cannot be null.")
request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
request_info.configure(request_configuration)
@ -116,7 +116,7 @@ class PostItemRequestBuilder(BaseRequestBuilder):
param raw_url: The raw URL to use for the request builder.
Returns: PostItemRequestBuilder
"""
if not raw_url:
if raw_url is None:
raise TypeError("raw_url cannot be null.")
return PostItemRequestBuilder(self.request_adapter, raw_url)

Просмотреть файл

@ -35,7 +35,7 @@ class PostsRequestBuilder(BaseRequestBuilder):
param post_id: key: id of post
Returns: PostItemRequestBuilder
"""
if not post_id:
if post_id is None:
raise TypeError("post_id cannot be null.")
from .item.post_item_request_builder import PostItemRequestBuilder
@ -65,7 +65,7 @@ class PostsRequestBuilder(BaseRequestBuilder):
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[Post]
"""
if not body:
if body is None:
raise TypeError("body cannot be null.")
request_info = self.to_post_request_information(
body, request_configuration
@ -94,7 +94,7 @@ class PostsRequestBuilder(BaseRequestBuilder):
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
if not body:
if body is None:
raise TypeError("body cannot be null.")
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
request_info.configure(request_configuration)
@ -108,7 +108,7 @@ class PostsRequestBuilder(BaseRequestBuilder):
param raw_url: The raw URL to use for the request builder.
Returns: PostsRequestBuilder
"""
if not raw_url:
if raw_url is None:
raise TypeError("raw_url cannot be null.")
return PostsRequestBuilder(self.request_adapter, raw_url)
@ -123,7 +123,7 @@ class PostsRequestBuilder(BaseRequestBuilder):
param original_name: The original query parameter name in the class.
Returns: str
"""
if not original_name:
if original_name is None:
raise TypeError("original_name cannot be null.")
if original_name == "user_id":
return "userId"

Просмотреть файл

@ -26,7 +26,7 @@ class PostsClient(BaseRequestBuilder):
param request_adapter: The request adapter to use to execute the requests.
Returns: None
"""
if not request_adapter:
if request_adapter is None:
raise TypeError("request_adapter cannot be null.")
super().__init__(request_adapter, "{+baseurl}", None)
register_default_serializer(JsonSerializationWriterFactory)

Просмотреть файл

@ -2,7 +2,7 @@
"descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B",
"descriptionLocation": "../../posts-api.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.16.0",
"kiotaVersion": "1.17.0",
"clientClassName": "PostsClient",
"clientNamespaceName": "ApiSdk",
"language": "TypeScript",

Просмотреть файл

@ -9,6 +9,7 @@ import { type AdditionalDataHolder, type Parsable, type ParseNode, type Serializ
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns {Post}
*/
// @ts-ignore
export function createPostFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoPost;
}
@ -16,6 +17,7 @@ export function createPostFromDiscriminatorValue(parseNode: ParseNode | undefine
* The deserialization information for the current model
* @returns {Record<string, (node: ParseNode) => void>}
*/
// @ts-ignore
export function deserializeIntoPost(post: Partial<Post> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"body": n => { post.body = n.getStringValue(); },
@ -50,6 +52,7 @@ export interface Post extends AdditionalDataHolder, Parsable {
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
// @ts-ignore
export function serializePost(writer: SerializationWriter, post: Partial<Post> | undefined = {}) : void {
writer.writeStringValue("body", post.body);
writer.writeNumberValue("id", post.id);

Просмотреть файл

@ -18,6 +18,7 @@ import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft
* Instantiates a new {@link PostsClient} and sets the default values.
* @param requestAdapter The request adapter to use to execute the requests.
*/
// @ts-ignore
export function createPostsClient(requestAdapter: RequestAdapter) {
registerDefaultSerializer(JsonSerializationWriterFactory);
registerDefaultSerializer(TextSerializationWriterFactory);