UNPKG

@microsoft/msgraph-sdk

Version:
431 lines 20.9 kB
/* tslint:disable */ /* eslint-disable */ // Generated by Microsoft Kiota // @ts-ignore import { createKeyValueFromDiscriminatorValue, deserializeIntoBaseCollectionPaginationCountResponse, deserializeIntoEntity, serializeBaseCollectionPaginationCountResponse, serializeEntity, serializeKeyValue } 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 {GroupCollectionResponse} */ // @ts-ignore export function createGroupCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoGroupCollectionResponse; } /** * 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 {Group} */ // @ts-ignore export function createGroupFromDiscriminatorValue(parseNode) { return deserializeIntoGroup; } /** * 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 {LocalizedDescription} */ // @ts-ignore export function createLocalizedDescriptionFromDiscriminatorValue(parseNode) { return deserializeIntoLocalizedDescription; } /** * 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 {LocalizedLabel} */ // @ts-ignore export function createLocalizedLabelFromDiscriminatorValue(parseNode) { return deserializeIntoLocalizedLabel; } /** * 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 {LocalizedName} */ // @ts-ignore export function createLocalizedNameFromDiscriminatorValue(parseNode) { return deserializeIntoLocalizedName; } /** * 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 {RelationCollectionResponse} */ // @ts-ignore export function createRelationCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoRelationCollectionResponse; } /** * 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 {Relation} */ // @ts-ignore export function createRelationFromDiscriminatorValue(parseNode) { return deserializeIntoRelation; } /** * 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 {SetCollectionResponse} */ // @ts-ignore export function createSetCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoSetCollectionResponse; } /** * 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 {Set} */ // @ts-ignore export function createSetFromDiscriminatorValue(parseNode) { return deserializeIntoSet; } /** * 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 {StoreCollectionResponse} */ // @ts-ignore export function createStoreCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoStoreCollectionResponse; } /** * 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 {Store} */ // @ts-ignore export function createStoreFromDiscriminatorValue(parseNode) { return deserializeIntoStore; } /** * 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 {TermCollectionResponse} */ // @ts-ignore export function createTermCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoTermCollectionResponse; } /** * 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 {Term} */ // @ts-ignore export function createTermFromDiscriminatorValue(parseNode) { return deserializeIntoTerm; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoGroup(group = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(group)), { "createdDateTime": n => { group.createdDateTime = n.getDateValue(); }, "description": n => { group.description = n.getStringValue(); }, "displayName": n => { group.displayName = n.getStringValue(); }, "parentSiteId": n => { group.parentSiteId = n.getStringValue(); }, "scope": n => { group.scope = n.getEnumValue(TermGroupScopeObject); }, "sets": n => { group.sets = n.getCollectionOfObjectValues(createSetFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoGroupCollectionResponse(groupCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(groupCollectionResponse)), { "value": n => { groupCollectionResponse.value = n.getCollectionOfObjectValues(createGroupFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoLocalizedDescription(localizedDescription = {}) { return { "backingStoreEnabled": n => { localizedDescription.backingStoreEnabled = true; }, "description": n => { localizedDescription.description = n.getStringValue(); }, "languageTag": n => { localizedDescription.languageTag = n.getStringValue(); }, "@odata.type": n => { localizedDescription.odataType = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoLocalizedLabel(localizedLabel = {}) { return { "backingStoreEnabled": n => { localizedLabel.backingStoreEnabled = true; }, "isDefault": n => { localizedLabel.isDefault = n.getBooleanValue(); }, "languageTag": n => { localizedLabel.languageTag = n.getStringValue(); }, "name": n => { localizedLabel.name = n.getStringValue(); }, "@odata.type": n => { localizedLabel.odataType = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoLocalizedName(localizedName = {}) { return { "backingStoreEnabled": n => { localizedName.backingStoreEnabled = true; }, "languageTag": n => { localizedName.languageTag = n.getStringValue(); }, "name": n => { localizedName.name = n.getStringValue(); }, "@odata.type": n => { localizedName.odataType = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoRelation(relation = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(relation)), { "fromTerm": n => { relation.fromTerm = n.getObjectValue(createTermFromDiscriminatorValue); }, "relationship": n => { relation.relationship = n.getEnumValue(RelationTypeObject); }, "set": n => { relation.set = n.getObjectValue(createSetFromDiscriminatorValue); }, "toTerm": n => { relation.toTerm = n.getObjectValue(createTermFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoRelationCollectionResponse(relationCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(relationCollectionResponse)), { "value": n => { relationCollectionResponse.value = n.getCollectionOfObjectValues(createRelationFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoSet(set = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(set)), { "children": n => { set.children = n.getCollectionOfObjectValues(createTermFromDiscriminatorValue); }, "createdDateTime": n => { set.createdDateTime = n.getDateValue(); }, "description": n => { set.description = n.getStringValue(); }, "localizedNames": n => { set.localizedNames = n.getCollectionOfObjectValues(createLocalizedNameFromDiscriminatorValue); }, "parentGroup": n => { set.parentGroup = n.getObjectValue(createGroupFromDiscriminatorValue); }, "properties": n => { set.properties = n.getCollectionOfObjectValues(createKeyValueFromDiscriminatorValue); }, "relations": n => { set.relations = n.getCollectionOfObjectValues(createRelationFromDiscriminatorValue); }, "terms": n => { set.terms = n.getCollectionOfObjectValues(createTermFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoSetCollectionResponse(setCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(setCollectionResponse)), { "value": n => { setCollectionResponse.value = n.getCollectionOfObjectValues(createSetFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoStore(store = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(store)), { "defaultLanguageTag": n => { store.defaultLanguageTag = n.getStringValue(); }, "groups": n => { store.groups = n.getCollectionOfObjectValues(createGroupFromDiscriminatorValue); }, "languageTags": n => { store.languageTags = n.getCollectionOfPrimitiveValues(); }, "sets": n => { store.sets = n.getCollectionOfObjectValues(createSetFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoStoreCollectionResponse(storeCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(storeCollectionResponse)), { "value": n => { storeCollectionResponse.value = n.getCollectionOfObjectValues(createStoreFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoTerm(term = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(term)), { "children": n => { term.children = n.getCollectionOfObjectValues(createTermFromDiscriminatorValue); }, "createdDateTime": n => { term.createdDateTime = n.getDateValue(); }, "descriptions": n => { term.descriptions = n.getCollectionOfObjectValues(createLocalizedDescriptionFromDiscriminatorValue); }, "labels": n => { term.labels = n.getCollectionOfObjectValues(createLocalizedLabelFromDiscriminatorValue); }, "lastModifiedDateTime": n => { term.lastModifiedDateTime = n.getDateValue(); }, "properties": n => { term.properties = n.getCollectionOfObjectValues(createKeyValueFromDiscriminatorValue); }, "relations": n => { term.relations = n.getCollectionOfObjectValues(createRelationFromDiscriminatorValue); }, "set": n => { term.set = n.getObjectValue(createSetFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoTermCollectionResponse(termCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(termCollectionResponse)), { "value": n => { termCollectionResponse.value = n.getCollectionOfObjectValues(createTermFromDiscriminatorValue); } }); } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeGroup(writer, group = {}) { if (group) { serializeEntity(writer, group); writer.writeDateValue("createdDateTime", group.createdDateTime); writer.writeStringValue("description", group.description); writer.writeStringValue("displayName", group.displayName); writer.writeStringValue("parentSiteId", group.parentSiteId); writer.writeEnumValue("scope", group.scope); writer.writeCollectionOfObjectValues("sets", group.sets, serializeSet); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeGroupCollectionResponse(writer, groupCollectionResponse = {}) { if (groupCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, groupCollectionResponse); writer.writeCollectionOfObjectValues("value", groupCollectionResponse.value, serializeGroup); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeLocalizedDescription(writer, localizedDescription = {}) { if (localizedDescription) { writer.writeStringValue("description", localizedDescription.description); writer.writeStringValue("languageTag", localizedDescription.languageTag); writer.writeStringValue("@odata.type", localizedDescription.odataType); writer.writeAdditionalData(localizedDescription.additionalData); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeLocalizedLabel(writer, localizedLabel = {}) { if (localizedLabel) { writer.writeBooleanValue("isDefault", localizedLabel.isDefault); writer.writeStringValue("languageTag", localizedLabel.languageTag); writer.writeStringValue("name", localizedLabel.name); writer.writeStringValue("@odata.type", localizedLabel.odataType); writer.writeAdditionalData(localizedLabel.additionalData); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeLocalizedName(writer, localizedName = {}) { if (localizedName) { writer.writeStringValue("languageTag", localizedName.languageTag); writer.writeStringValue("name", localizedName.name); writer.writeStringValue("@odata.type", localizedName.odataType); writer.writeAdditionalData(localizedName.additionalData); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeRelation(writer, relation = {}) { if (relation) { serializeEntity(writer, relation); writer.writeObjectValue("fromTerm", relation.fromTerm, serializeTerm); writer.writeEnumValue("relationship", relation.relationship); writer.writeObjectValue("set", relation.set, serializeSet); writer.writeObjectValue("toTerm", relation.toTerm, serializeTerm); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeRelationCollectionResponse(writer, relationCollectionResponse = {}) { if (relationCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, relationCollectionResponse); writer.writeCollectionOfObjectValues("value", relationCollectionResponse.value, serializeRelation); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeSet(writer, set = {}) { if (set) { serializeEntity(writer, set); writer.writeCollectionOfObjectValues("children", set.children, serializeTerm); writer.writeDateValue("createdDateTime", set.createdDateTime); writer.writeStringValue("description", set.description); writer.writeCollectionOfObjectValues("localizedNames", set.localizedNames, serializeLocalizedName); writer.writeObjectValue("parentGroup", set.parentGroup, serializeGroup); writer.writeCollectionOfObjectValues("properties", set.properties, serializeKeyValue); writer.writeCollectionOfObjectValues("relations", set.relations, serializeRelation); writer.writeCollectionOfObjectValues("terms", set.terms, serializeTerm); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeSetCollectionResponse(writer, setCollectionResponse = {}) { if (setCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, setCollectionResponse); writer.writeCollectionOfObjectValues("value", setCollectionResponse.value, serializeSet); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeStore(writer, store = {}) { if (store) { serializeEntity(writer, store); writer.writeStringValue("defaultLanguageTag", store.defaultLanguageTag); writer.writeCollectionOfObjectValues("groups", store.groups, serializeGroup); writer.writeCollectionOfPrimitiveValues("languageTags", store.languageTags); writer.writeCollectionOfObjectValues("sets", store.sets, serializeSet); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeStoreCollectionResponse(writer, storeCollectionResponse = {}) { if (storeCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, storeCollectionResponse); writer.writeCollectionOfObjectValues("value", storeCollectionResponse.value, serializeStore); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeTerm(writer, term = {}) { if (term) { serializeEntity(writer, term); writer.writeCollectionOfObjectValues("children", term.children, serializeTerm); writer.writeDateValue("createdDateTime", term.createdDateTime); writer.writeCollectionOfObjectValues("descriptions", term.descriptions, serializeLocalizedDescription); writer.writeCollectionOfObjectValues("labels", term.labels, serializeLocalizedLabel); writer.writeDateValue("lastModifiedDateTime", term.lastModifiedDateTime); writer.writeCollectionOfObjectValues("properties", term.properties, serializeKeyValue); writer.writeCollectionOfObjectValues("relations", term.relations, serializeRelation); writer.writeObjectValue("set", term.set, serializeSet); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeTermCollectionResponse(writer, termCollectionResponse = {}) { if (termCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, termCollectionResponse); writer.writeCollectionOfObjectValues("value", termCollectionResponse.value, serializeTerm); } } export const RelationTypeObject = { Pin: "pin", Reuse: "reuse", UnknownFutureValue: "unknownFutureValue", }; export const TermGroupScopeObject = { Global: "global", System: "system", SiteCollection: "siteCollection", UnknownFutureValue: "unknownFutureValue", }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map