From 26e8e214ba6d9f48d7e9d4468300888ba7df905c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 14 Aug 2024 15:14:19 -0400 Subject: [PATCH] chore: refreshes getting started ts client --- .../typescript/client/kiota-lock.json | 2 +- .../typescript/client/models/index.ts | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/get-started/quickstart/typescript/client/kiota-lock.json b/get-started/quickstart/typescript/client/kiota-lock.json index 5b23415d3..33aeceb12 100644 --- a/get-started/quickstart/typescript/client/kiota-lock.json +++ b/get-started/quickstart/typescript/client/kiota-lock.json @@ -2,7 +2,7 @@ "descriptionHash": "37FE8D63AB108F248AAA5632A5D37D625F8B9E3A6C439952B4029B0AF49579F337028FE07768B89D6F9210460D77E116F312CB505A43E8EB877131E772464F3B", "descriptionLocation": "../../posts-api.yml", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.17.0", + "kiotaVersion": "1.18.0", "clientClassName": "PostsClient", "clientNamespaceName": "ApiSdk", "language": "TypeScript", diff --git a/get-started/quickstart/typescript/client/models/index.ts b/get-started/quickstart/typescript/client/models/index.ts index 08ebeef5d..ca611b501 100644 --- a/get-started/quickstart/typescript/client/models/index.ts +++ b/get-started/quickstart/typescript/client/models/index.ts @@ -18,7 +18,7 @@ export function createPostFromDiscriminatorValue(parseNode: ParseNode | undefine * @returns {Record void>} */ // @ts-ignore -export function deserializeIntoPost(post: Partial | undefined = {}) : Record void> { +export function deserializeIntoPost(post: Partial | undefined | null = {}) : Record void> { return { "body": n => { post.body = n.getStringValue(); }, "id": n => { post.id = n.getNumberValue(); }, @@ -34,31 +34,33 @@ export interface Post extends AdditionalDataHolder, Parsable { /** * The body property */ - body?: string; + body?: string | null; /** * The id property */ - id?: number; + id?: number | null; /** * The title property */ - title?: string; + title?: string | null; /** * The userId property */ - userId?: number; + userId?: number | null; } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore -export function serializePost(writer: SerializationWriter, post: Partial | undefined = {}) : void { - writer.writeStringValue("body", post.body); - writer.writeNumberValue("id", post.id); - writer.writeStringValue("title", post.title); - writer.writeNumberValue("userId", post.userId); - writer.writeAdditionalData(post.additionalData); +export function serializePost(writer: SerializationWriter, post: Partial | undefined | null = {}) : void { + if (post) { + writer.writeStringValue("body", post.body); + writer.writeNumberValue("id", post.id); + writer.writeStringValue("title", post.title); + writer.writeNumberValue("userId", post.userId); + writer.writeAdditionalData(post.additionalData); + } } /* tslint:enable */ /* eslint-enable */