UNPKG

@microsoft/msgraph-sdk

Version:
456 lines 23.4 kB
/* tslint:disable */ /* eslint-disable */ // Generated by Microsoft Kiota // @ts-ignore import { deserializeIntoBaseCollectionPaginationCountResponse, deserializeIntoEntity, DevicePlatformTypeObject, serializeBaseCollectionPaginationCountResponse, serializeEntity } from '../index.js'; /** * 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 {AcronymCollectionResponse} */ // @ts-ignore export function createAcronymCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoAcronymCollectionResponse; } /** * 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 {Acronym} */ // @ts-ignore export function createAcronymFromDiscriminatorValue(parseNode) { return deserializeIntoAcronym; } /** * 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 {AnswerKeyword} */ // @ts-ignore export function createAnswerKeywordFromDiscriminatorValue(parseNode) { return deserializeIntoAnswerKeyword; } /** * 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 {AnswerVariant} */ // @ts-ignore export function createAnswerVariantFromDiscriminatorValue(parseNode) { return deserializeIntoAnswerVariant; } /** * 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 {BookmarkCollectionResponse} */ // @ts-ignore export function createBookmarkCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoBookmarkCollectionResponse; } /** * 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 {Bookmark} */ // @ts-ignore export function createBookmarkFromDiscriminatorValue(parseNode) { return deserializeIntoBookmark; } /** * 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 {Identity} */ // @ts-ignore export function createIdentityFromDiscriminatorValue(parseNode) { return deserializeIntoIdentity; } /** * 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 {IdentitySet} */ // @ts-ignore export function createIdentitySetFromDiscriminatorValue(parseNode) { return deserializeIntoIdentitySet; } /** * 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 {QnaCollectionResponse} */ // @ts-ignore export function createQnaCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoQnaCollectionResponse; } /** * 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 {Qna} */ // @ts-ignore export function createQnaFromDiscriminatorValue(parseNode) { return deserializeIntoQna; } /** * 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 {SearchAnswer} */ // @ts-ignore export function createSearchAnswerFromDiscriminatorValue(parseNode) { if (!parseNode) throw new Error("parseNode cannot be undefined"); const mappingValueNode = parseNode === null || parseNode === void 0 ? void 0 : parseNode.getChildNode("@odata.type"); if (mappingValueNode) { const mappingValue = mappingValueNode.getStringValue(); if (mappingValue) { switch (mappingValue) { case "#microsoft.graph.search.acronym": return deserializeIntoAcronym; case "#microsoft.graph.search.bookmark": return deserializeIntoBookmark; case "#microsoft.graph.search.qna": return deserializeIntoQna; } } } return deserializeIntoSearchAnswer; } /** * The deserialization information for the current model * @param Acronym The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoAcronym(acronym = {}) { return Object.assign(Object.assign({}, deserializeIntoSearchAnswer(acronym)), { "standsFor": n => { acronym.standsFor = n.getStringValue(); }, "state": n => { acronym.state = n.getEnumValue(AnswerStateObject); } }); } /** * The deserialization information for the current model * @param AcronymCollectionResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoAcronymCollectionResponse(acronymCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(acronymCollectionResponse)), { "value": n => { acronymCollectionResponse.value = n.getCollectionOfObjectValues(createAcronymFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param AnswerKeyword The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoAnswerKeyword(answerKeyword = {}) { return { "backingStoreEnabled": n => { answerKeyword.backingStoreEnabled = true; }, "keywords": n => { answerKeyword.keywords = n.getCollectionOfPrimitiveValues(); }, "matchSimilarKeywords": n => { answerKeyword.matchSimilarKeywords = n.getBooleanValue(); }, "@odata.type": n => { answerKeyword.odataType = n.getStringValue(); }, "reservedKeywords": n => { answerKeyword.reservedKeywords = n.getCollectionOfPrimitiveValues(); }, }; } /** * The deserialization information for the current model * @param AnswerVariant The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoAnswerVariant(answerVariant = {}) { return { "backingStoreEnabled": n => { answerVariant.backingStoreEnabled = true; }, "description": n => { answerVariant.description = n.getStringValue(); }, "displayName": n => { answerVariant.displayName = n.getStringValue(); }, "languageTag": n => { answerVariant.languageTag = n.getStringValue(); }, "@odata.type": n => { answerVariant.odataType = n.getStringValue(); }, "platform": n => { answerVariant.platform = n.getEnumValue(DevicePlatformTypeObject); }, "webUrl": n => { answerVariant.webUrl = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @param Bookmark The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBookmark(bookmark = {}) { return Object.assign(Object.assign({}, deserializeIntoSearchAnswer(bookmark)), { "availabilityEndDateTime": n => { bookmark.availabilityEndDateTime = n.getDateValue(); }, "availabilityStartDateTime": n => { bookmark.availabilityStartDateTime = n.getDateValue(); }, "categories": n => { bookmark.categories = n.getCollectionOfPrimitiveValues(); }, "groupIds": n => { bookmark.groupIds = n.getCollectionOfPrimitiveValues(); }, "isSuggested": n => { bookmark.isSuggested = n.getBooleanValue(); }, "keywords": n => { bookmark.keywords = n.getObjectValue(createAnswerKeywordFromDiscriminatorValue); }, "languageTags": n => { bookmark.languageTags = n.getCollectionOfPrimitiveValues(); }, "platforms": n => { bookmark.platforms = n.getCollectionOfEnumValues(DevicePlatformTypeObject); }, "powerAppIds": n => { bookmark.powerAppIds = n.getCollectionOfPrimitiveValues(); }, "state": n => { bookmark.state = n.getEnumValue(AnswerStateObject); }, "targetedVariations": n => { bookmark.targetedVariations = n.getCollectionOfObjectValues(createAnswerVariantFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param BookmarkCollectionResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBookmarkCollectionResponse(bookmarkCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(bookmarkCollectionResponse)), { "value": n => { bookmarkCollectionResponse.value = n.getCollectionOfObjectValues(createBookmarkFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param Identity The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoIdentity(identity = {}) { return { "backingStoreEnabled": n => { identity.backingStoreEnabled = true; }, "displayName": n => { identity.displayName = n.getStringValue(); }, "id": n => { identity.id = n.getStringValue(); }, "@odata.type": n => { identity.odataType = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @param IdentitySet The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoIdentitySet(identitySet = {}) { return { "application": n => { identitySet.application = n.getObjectValue(createIdentityFromDiscriminatorValue); }, "backingStoreEnabled": n => { identitySet.backingStoreEnabled = true; }, "device": n => { identitySet.device = n.getObjectValue(createIdentityFromDiscriminatorValue); }, "@odata.type": n => { identitySet.odataType = n.getStringValue(); }, "user": n => { identitySet.user = n.getObjectValue(createIdentityFromDiscriminatorValue); }, }; } /** * The deserialization information for the current model * @param Qna The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoQna(qna = {}) { return Object.assign(Object.assign({}, deserializeIntoSearchAnswer(qna)), { "availabilityEndDateTime": n => { qna.availabilityEndDateTime = n.getDateValue(); }, "availabilityStartDateTime": n => { qna.availabilityStartDateTime = n.getDateValue(); }, "groupIds": n => { qna.groupIds = n.getCollectionOfPrimitiveValues(); }, "isSuggested": n => { qna.isSuggested = n.getBooleanValue(); }, "keywords": n => { qna.keywords = n.getObjectValue(createAnswerKeywordFromDiscriminatorValue); }, "languageTags": n => { qna.languageTags = n.getCollectionOfPrimitiveValues(); }, "platforms": n => { qna.platforms = n.getCollectionOfEnumValues(DevicePlatformTypeObject); }, "state": n => { qna.state = n.getEnumValue(AnswerStateObject); }, "targetedVariations": n => { qna.targetedVariations = n.getCollectionOfObjectValues(createAnswerVariantFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param QnaCollectionResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoQnaCollectionResponse(qnaCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(qnaCollectionResponse)), { "value": n => { qnaCollectionResponse.value = n.getCollectionOfObjectValues(createQnaFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param SearchAnswer The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoSearchAnswer(searchAnswer = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(searchAnswer)), { "description": n => { searchAnswer.description = n.getStringValue(); }, "displayName": n => { searchAnswer.displayName = n.getStringValue(); }, "lastModifiedBy": n => { searchAnswer.lastModifiedBy = n.getObjectValue(createIdentitySetFromDiscriminatorValue); }, "lastModifiedDateTime": n => { searchAnswer.lastModifiedDateTime = n.getDateValue(); }, "webUrl": n => { searchAnswer.webUrl = n.getStringValue(); } }); } /** * Serializes information the current object * @param Acronym The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeAcronym(writer, acronym = {}, isSerializingDerivedType = false) { if (!acronym || isSerializingDerivedType) { return; } serializeSearchAnswer(writer, acronym, isSerializingDerivedType); writer.writeStringValue("standsFor", acronym.standsFor); writer.writeEnumValue("state", acronym.state); } /** * Serializes information the current object * @param AcronymCollectionResponse The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeAcronymCollectionResponse(writer, acronymCollectionResponse = {}, isSerializingDerivedType = false) { if (!acronymCollectionResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, acronymCollectionResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", acronymCollectionResponse.value, serializeAcronym); } /** * Serializes information the current object * @param AnswerKeyword The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeAnswerKeyword(writer, answerKeyword = {}, isSerializingDerivedType = false) { if (!answerKeyword || isSerializingDerivedType) { return; } writer.writeCollectionOfPrimitiveValues("keywords", answerKeyword.keywords); writer.writeBooleanValue("matchSimilarKeywords", answerKeyword.matchSimilarKeywords); writer.writeStringValue("@odata.type", answerKeyword.odataType); writer.writeCollectionOfPrimitiveValues("reservedKeywords", answerKeyword.reservedKeywords); writer.writeAdditionalData(answerKeyword.additionalData); } /** * Serializes information the current object * @param AnswerVariant The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeAnswerVariant(writer, answerVariant = {}, isSerializingDerivedType = false) { if (!answerVariant || isSerializingDerivedType) { return; } writer.writeStringValue("description", answerVariant.description); writer.writeStringValue("displayName", answerVariant.displayName); writer.writeStringValue("languageTag", answerVariant.languageTag); writer.writeStringValue("@odata.type", answerVariant.odataType); writer.writeEnumValue("platform", answerVariant.platform); writer.writeStringValue("webUrl", answerVariant.webUrl); writer.writeAdditionalData(answerVariant.additionalData); } /** * Serializes information the current object * @param Bookmark The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBookmark(writer, bookmark = {}, isSerializingDerivedType = false) { if (!bookmark || isSerializingDerivedType) { return; } serializeSearchAnswer(writer, bookmark, isSerializingDerivedType); writer.writeDateValue("availabilityEndDateTime", bookmark.availabilityEndDateTime); writer.writeDateValue("availabilityStartDateTime", bookmark.availabilityStartDateTime); writer.writeCollectionOfPrimitiveValues("categories", bookmark.categories); writer.writeCollectionOfPrimitiveValues("groupIds", bookmark.groupIds); writer.writeBooleanValue("isSuggested", bookmark.isSuggested); writer.writeObjectValue("keywords", bookmark.keywords, serializeAnswerKeyword); writer.writeCollectionOfPrimitiveValues("languageTags", bookmark.languageTags); if (bookmark.platforms) writer.writeCollectionOfEnumValues("platforms", bookmark.platforms); writer.writeCollectionOfPrimitiveValues("powerAppIds", bookmark.powerAppIds); writer.writeEnumValue("state", bookmark.state); writer.writeCollectionOfObjectValues("targetedVariations", bookmark.targetedVariations, serializeAnswerVariant); } /** * Serializes information the current object * @param BookmarkCollectionResponse The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBookmarkCollectionResponse(writer, bookmarkCollectionResponse = {}, isSerializingDerivedType = false) { if (!bookmarkCollectionResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, bookmarkCollectionResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", bookmarkCollectionResponse.value, serializeBookmark); } /** * Serializes information the current object * @param Identity The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeIdentity(writer, identity = {}, isSerializingDerivedType = false) { if (!identity || isSerializingDerivedType) { return; } writer.writeStringValue("displayName", identity.displayName); writer.writeStringValue("id", identity.id); writer.writeStringValue("@odata.type", identity.odataType); writer.writeAdditionalData(identity.additionalData); } /** * Serializes information the current object * @param IdentitySet The instance to serialize from. * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeIdentitySet(writer, identitySet = {}, isSerializingDerivedType = false) { if (!identitySet || isSerializingDerivedType) { return; } writer.writeObjectValue("application", identitySet.application, serializeIdentity); writer.writeObjectValue("device", identitySet.device, serializeIdentity); writer.writeStringValue("@odata.type", identitySet.odataType); writer.writeObjectValue("user", identitySet.user, serializeIdentity); writer.writeAdditionalData(identitySet.additionalData); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param Qna The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeQna(writer, qna = {}, isSerializingDerivedType = false) { if (!qna || isSerializingDerivedType) { return; } serializeSearchAnswer(writer, qna, isSerializingDerivedType); writer.writeDateValue("availabilityEndDateTime", qna.availabilityEndDateTime); writer.writeDateValue("availabilityStartDateTime", qna.availabilityStartDateTime); writer.writeCollectionOfPrimitiveValues("groupIds", qna.groupIds); writer.writeBooleanValue("isSuggested", qna.isSuggested); writer.writeObjectValue("keywords", qna.keywords, serializeAnswerKeyword); writer.writeCollectionOfPrimitiveValues("languageTags", qna.languageTags); if (qna.platforms) writer.writeCollectionOfEnumValues("platforms", qna.platforms); writer.writeEnumValue("state", qna.state); writer.writeCollectionOfObjectValues("targetedVariations", qna.targetedVariations, serializeAnswerVariant); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param QnaCollectionResponse The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeQnaCollectionResponse(writer, qnaCollectionResponse = {}, isSerializingDerivedType = false) { if (!qnaCollectionResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, qnaCollectionResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", qnaCollectionResponse.value, serializeQna); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param SearchAnswer The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeSearchAnswer(writer, searchAnswer = {}, isSerializingDerivedType = false) { if (!searchAnswer || isSerializingDerivedType) { return; } serializeEntity(writer, searchAnswer, isSerializingDerivedType); writer.writeStringValue("description", searchAnswer.description); writer.writeStringValue("displayName", searchAnswer.displayName); writer.writeObjectValue("lastModifiedBy", searchAnswer.lastModifiedBy, serializeIdentitySet); writer.writeDateValue("lastModifiedDateTime", searchAnswer.lastModifiedDateTime); writer.writeStringValue("webUrl", searchAnswer.webUrl); switch (searchAnswer.odataType) { case "#microsoft.graph.search.acronym": serializeAcronym(writer, searchAnswer, true); break; case "#microsoft.graph.search.bookmark": serializeBookmark(writer, searchAnswer, true); break; case "#microsoft.graph.search.qna": serializeQna(writer, searchAnswer, true); break; } } export const AnswerStateObject = { Published: "published", Draft: "draft", Excluded: "excluded", UnknownFutureValue: "unknownFutureValue", }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map