Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated models and request builders #489

Merged
merged 6 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "1.0.0-preview.11"
"version": "1.0.0-preview.12"
}
270 changes: 135 additions & 135 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { type AdditionalDataHolder, type BackedModel, type BackingStore, type Ba
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a publishPostRequestBody
*/
export function createPublishPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createPublishPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoPublishPostRequestBody;
}
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoPublishPostRequestBody(publishPostRequestBody: PublishPostRequestBody | undefined = {} as PublishPostRequestBody) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoPublishPostRequestBody(publishPostRequestBody: Partial<PublishPostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { publishPostRequestBody.backingStoreEnabled = true; },
"revision": n => { publishPostRequestBody.revision = n.getStringValue(); },
Expand Down Expand Up @@ -71,7 +71,7 @@ export interface PublishRequestBuilder extends BaseRequestBuilder<PublishRequest
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializePublishPostRequestBody(writer: SerializationWriter, publishPostRequestBody: PublishPostRequestBody | undefined = {} as PublishPostRequestBody) : void {
export function serializePublishPostRequestBody(writer: SerializationWriter, publishPostRequestBody: Partial<PublishPostRequestBody> | undefined = {}) : void {
writer.writeStringValue("revision", publishPostRequestBody.revision);
writer.writeCollectionOfObjectValues<BrowserSharedCookie>("sharedCookies", publishPostRequestBody.sharedCookies, serializeBrowserSharedCookie);
writer.writeCollectionOfObjectValues<BrowserSite>("sites", publishPostRequestBody.sites, serializeBrowserSite);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ export interface ArchiveRequestBuilder extends BaseRequestBuilder<ArchiveRequest
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a archivePostRequestBody
*/
export function createArchivePostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createArchivePostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoArchivePostRequestBody;
}
/**
* 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 archivePostResponse
*/
export function createArchivePostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createArchivePostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoArchivePostResponse;
}
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoArchivePostRequestBody(archivePostRequestBody: ArchivePostRequestBody | undefined = {} as ArchivePostRequestBody) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoArchivePostRequestBody(archivePostRequestBody: Partial<ArchivePostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { archivePostRequestBody.backingStoreEnabled = true; },
"messageIds": n => { archivePostRequestBody.messageIds = n.getCollectionOfPrimitiveValues<string>(); },
Expand All @@ -82,7 +82,7 @@ export function deserializeIntoArchivePostRequestBody(archivePostRequestBody: Ar
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoArchivePostResponse(archivePostResponse: ArchivePostResponse | undefined = {} as ArchivePostResponse) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoArchivePostResponse(archivePostResponse: Partial<ArchivePostResponse> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { archivePostResponse.backingStoreEnabled = true; },
"value": n => { archivePostResponse.value = n.getBooleanValue(); },
Expand All @@ -92,15 +92,15 @@ export function deserializeIntoArchivePostResponse(archivePostResponse: ArchiveP
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeArchivePostRequestBody(writer: SerializationWriter, archivePostRequestBody: ArchivePostRequestBody | undefined = {} as ArchivePostRequestBody) : void {
export function serializeArchivePostRequestBody(writer: SerializationWriter, archivePostRequestBody: Partial<ArchivePostRequestBody> | undefined = {}) : void {
writer.writeCollectionOfPrimitiveValues<string>("messageIds", archivePostRequestBody.messageIds);
writer.writeAdditionalData(archivePostRequestBody.additionalData);
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeArchivePostResponse(writer: SerializationWriter, archivePostResponse: ArchivePostResponse | undefined = {} as ArchivePostResponse) : void {
export function serializeArchivePostResponse(writer: SerializationWriter, archivePostResponse: Partial<ArchivePostResponse> | undefined = {}) : void {
writer.writeBooleanValue("value", archivePostResponse.value);
writer.writeAdditionalData(archivePostResponse.additionalData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import { type AdditionalDataHolder, type BackedModel, type BackingStore, type Ba
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a favoritePostRequestBody
*/
export function createFavoritePostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createFavoritePostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoFavoritePostRequestBody;
}
/**
* 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 favoritePostResponse
*/
export function createFavoritePostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createFavoritePostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoFavoritePostResponse;
}
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoFavoritePostRequestBody(favoritePostRequestBody: FavoritePostRequestBody | undefined = {} as FavoritePostRequestBody) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoFavoritePostRequestBody(favoritePostRequestBody: Partial<FavoritePostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { favoritePostRequestBody.backingStoreEnabled = true; },
"messageIds": n => { favoritePostRequestBody.messageIds = n.getCollectionOfPrimitiveValues<string>(); },
Expand All @@ -34,7 +34,7 @@ export function deserializeIntoFavoritePostRequestBody(favoritePostRequestBody:
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoFavoritePostResponse(favoritePostResponse: FavoritePostResponse | undefined = {} as FavoritePostResponse) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoFavoritePostResponse(favoritePostResponse: Partial<FavoritePostResponse> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { favoritePostResponse.backingStoreEnabled = true; },
"value": n => { favoritePostResponse.value = n.getBooleanValue(); },
Expand Down Expand Up @@ -92,15 +92,15 @@ export interface FavoriteRequestBuilder extends BaseRequestBuilder<FavoriteReque
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeFavoritePostRequestBody(writer: SerializationWriter, favoritePostRequestBody: FavoritePostRequestBody | undefined = {} as FavoritePostRequestBody) : void {
export function serializeFavoritePostRequestBody(writer: SerializationWriter, favoritePostRequestBody: Partial<FavoritePostRequestBody> | undefined = {}) : void {
writer.writeCollectionOfPrimitiveValues<string>("messageIds", favoritePostRequestBody.messageIds);
writer.writeAdditionalData(favoritePostRequestBody.additionalData);
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeFavoritePostResponse(writer: SerializationWriter, favoritePostResponse: FavoritePostResponse | undefined = {} as FavoritePostResponse) : void {
export function serializeFavoritePostResponse(writer: SerializationWriter, favoritePostResponse: Partial<FavoritePostResponse> | undefined = {}) : void {
writer.writeBooleanValue("value", favoritePostResponse.value);
writer.writeAdditionalData(favoritePostResponse.additionalData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import { type AdditionalDataHolder, type BackedModel, type BackingStore, type Ba
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a markReadPostRequestBody
*/
export function createMarkReadPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createMarkReadPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoMarkReadPostRequestBody;
}
/**
* 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 markReadPostResponse
*/
export function createMarkReadPostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createMarkReadPostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoMarkReadPostResponse;
}
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoMarkReadPostRequestBody(markReadPostRequestBody: MarkReadPostRequestBody | undefined = {} as MarkReadPostRequestBody) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoMarkReadPostRequestBody(markReadPostRequestBody: Partial<MarkReadPostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { markReadPostRequestBody.backingStoreEnabled = true; },
"messageIds": n => { markReadPostRequestBody.messageIds = n.getCollectionOfPrimitiveValues<string>(); },
Expand All @@ -34,7 +34,7 @@ export function deserializeIntoMarkReadPostRequestBody(markReadPostRequestBody:
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoMarkReadPostResponse(markReadPostResponse: MarkReadPostResponse | undefined = {} as MarkReadPostResponse) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoMarkReadPostResponse(markReadPostResponse: Partial<MarkReadPostResponse> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { markReadPostResponse.backingStoreEnabled = true; },
"value": n => { markReadPostResponse.value = n.getBooleanValue(); },
Expand Down Expand Up @@ -92,15 +92,15 @@ export interface MarkReadRequestBuilder extends BaseRequestBuilder<MarkReadReque
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeMarkReadPostRequestBody(writer: SerializationWriter, markReadPostRequestBody: MarkReadPostRequestBody | undefined = {} as MarkReadPostRequestBody) : void {
export function serializeMarkReadPostRequestBody(writer: SerializationWriter, markReadPostRequestBody: Partial<MarkReadPostRequestBody> | undefined = {}) : void {
writer.writeCollectionOfPrimitiveValues<string>("messageIds", markReadPostRequestBody.messageIds);
writer.writeAdditionalData(markReadPostRequestBody.additionalData);
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeMarkReadPostResponse(writer: SerializationWriter, markReadPostResponse: MarkReadPostResponse | undefined = {} as MarkReadPostResponse) : void {
export function serializeMarkReadPostResponse(writer: SerializationWriter, markReadPostResponse: Partial<MarkReadPostResponse> | undefined = {}) : void {
writer.writeBooleanValue("value", markReadPostResponse.value);
writer.writeAdditionalData(markReadPostResponse.additionalData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import { type AdditionalDataHolder, type BackedModel, type BackingStore, type Ba
* @param parseNode The parse node to use to read the discriminator value and create the object
* @returns a markUnreadPostRequestBody
*/
export function createMarkUnreadPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createMarkUnreadPostRequestBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoMarkUnreadPostRequestBody;
}
/**
* 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 markUnreadPostResponse
*/
export function createMarkUnreadPostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) {
export function createMarkUnreadPostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
return deserializeIntoMarkUnreadPostResponse;
}
/**
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoMarkUnreadPostRequestBody(markUnreadPostRequestBody: MarkUnreadPostRequestBody | undefined = {} as MarkUnreadPostRequestBody) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoMarkUnreadPostRequestBody(markUnreadPostRequestBody: Partial<MarkUnreadPostRequestBody> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { markUnreadPostRequestBody.backingStoreEnabled = true; },
"messageIds": n => { markUnreadPostRequestBody.messageIds = n.getCollectionOfPrimitiveValues<string>(); },
Expand All @@ -34,7 +34,7 @@ export function deserializeIntoMarkUnreadPostRequestBody(markUnreadPostRequestBo
* The deserialization information for the current model
* @returns a Record<string, (node: ParseNode) => void>
*/
export function deserializeIntoMarkUnreadPostResponse(markUnreadPostResponse: MarkUnreadPostResponse | undefined = {} as MarkUnreadPostResponse) : Record<string, (node: ParseNode) => void> {
export function deserializeIntoMarkUnreadPostResponse(markUnreadPostResponse: Partial<MarkUnreadPostResponse> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"backingStoreEnabled": n => { markUnreadPostResponse.backingStoreEnabled = true; },
"value": n => { markUnreadPostResponse.value = n.getBooleanValue(); },
Expand Down Expand Up @@ -92,15 +92,15 @@ export interface MarkUnreadRequestBuilder extends BaseRequestBuilder<MarkUnreadR
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeMarkUnreadPostRequestBody(writer: SerializationWriter, markUnreadPostRequestBody: MarkUnreadPostRequestBody | undefined = {} as MarkUnreadPostRequestBody) : void {
export function serializeMarkUnreadPostRequestBody(writer: SerializationWriter, markUnreadPostRequestBody: Partial<MarkUnreadPostRequestBody> | undefined = {}) : void {
writer.writeCollectionOfPrimitiveValues<string>("messageIds", markUnreadPostRequestBody.messageIds);
writer.writeAdditionalData(markUnreadPostRequestBody.additionalData);
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
export function serializeMarkUnreadPostResponse(writer: SerializationWriter, markUnreadPostResponse: MarkUnreadPostResponse | undefined = {} as MarkUnreadPostResponse) : void {
export function serializeMarkUnreadPostResponse(writer: SerializationWriter, markUnreadPostResponse: Partial<MarkUnreadPostResponse> | undefined = {}) : void {
writer.writeBooleanValue("value", markUnreadPostResponse.value);
writer.writeAdditionalData(markUnreadPostResponse.additionalData);
}
Expand Down
Loading