/* 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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
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}
 */
export function createTermFromDiscriminatorValue(parseNode) {
    return deserializeIntoTerm;
}
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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>}
 */
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
 */
export function serializeGroup(writer, 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
 */
export function serializeGroupCollectionResponse(writer, 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
 */
export function serializeLocalizedDescription(writer, 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
 */
export function serializeLocalizedLabel(writer, 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
 */
export function serializeLocalizedName(writer, 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
 */
export function serializeRelation(writer, 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
 */
export function serializeRelationCollectionResponse(writer, 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
 */
export function serializeSet(writer, 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
 */
export function serializeSetCollectionResponse(writer, 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
 */
export function serializeStore(writer, 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
 */
export function serializeStoreCollectionResponse(writer, 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
 */
export function serializeTerm(writer, 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
 */
export function serializeTermCollectionResponse(writer, 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