/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { hashArray, uuid, } from '@finos/legend-shared';
import { V1_PackageableElement, } from '../V1_PackageableElement.js';
import { CORE_HASH_STRUCTURE, hashObjectWithoutSourceInformation, } from '../../../../../../../graph/Core_HashUtils.js';
export const V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE = 'dataProduct';
export var V1_DataProductTypeValue;
(function (V1_DataProductTypeValue) {
    V1_DataProductTypeValue["INTERNAL"] = "internalDataProductType";
    V1_DataProductTypeValue["EXTERNAL"] = "externalDataProductType";
})(V1_DataProductTypeValue || (V1_DataProductTypeValue = {}));
export class V1_AccessPoint {
    id;
    title;
    description;
    stereotypes = [];
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT,
            this.id,
            this.title ?? '',
            this.description ?? '',
            hashArray(this.stereotypes),
        ]);
    }
}
export class V1_LakehouseAccessPoint extends V1_AccessPoint {
    targetEnvironment;
    classification;
    func;
    reproducible;
    get hashCode() {
        return hashArray([
            super.hashCode,
            CORE_HASH_STRUCTURE.LAKEHOUSE_ACCESS_POINT,
            this.targetEnvironment,
            this.classification ?? '',
            this.func,
            this.reproducible ?? '',
        ]);
    }
}
// handle incoming accesspoints not yet modeled
export class V1_UnknownAccessPoint extends V1_AccessPoint {
    content;
    get hashCode() {
        return hashArray([
            super.hashCode,
            CORE_HASH_STRUCTURE.UNKNOWN_ACCESS_POINT,
            hashObjectWithoutSourceInformation(this.content),
        ]);
    }
}
export class V1_FunctionAccessPoint extends V1_AccessPoint {
    query;
    get hashCode() {
        return hashArray([
            super.hashCode,
            CORE_HASH_STRUCTURE.FUNCTION_ACCESS_POINT,
            this.query,
        ]);
    }
}
export class V1_AccessPointGroup {
    id;
    title;
    description;
    stereotypes = [];
    accessPoints = [];
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT_GROUP,
            this.id,
            this.title ?? '',
            this.description ?? '',
            hashArray(this.accessPoints),
            hashArray(this.stereotypes),
        ]);
    }
}
export class V1_Email {
    title;
    address;
    get hashCode() {
        return hashArray([CORE_HASH_STRUCTURE.EMAIL, this.title, this.address]);
    }
}
export class V1_DataProductLink {
    label;
    url;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_LINK,
            this.label ?? '',
            this.url,
        ]);
    }
}
export class V1_SupportInfo {
    documentation;
    website;
    faqUrl;
    supportUrl;
    emails = [];
    expertise;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.SUPPORT_INFO,
            this.documentation ?? '',
            this.website ?? '',
            this.faqUrl ?? '',
            this.supportUrl ?? '',
            hashArray(this.emails),
            hashArray(this.expertise ?? []),
        ]);
    }
}
export class V1_DataProductRuntimeInfo {
    id;
    description;
    runtime;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_RUNTIME_INFO,
            this.id,
            this.description ?? '',
            this.runtime.path,
        ]);
    }
}
export class V1_ElementScope {
    exclude;
    element;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_ELEMENT_SCOPE,
            this.exclude ?? '',
            this.element.path,
        ]);
    }
}
export class V1_DataProductDiagram {
    title;
    description;
    diagram;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_DIAGRAM,
            this.title,
            this.description ?? '',
            this.diagram.path,
        ]);
    }
}
export class V1_ModelAccessPointGroup extends V1_AccessPointGroup {
    mapping;
    featuredElements;
    diagrams = [];
    get hashCode() {
        return hashArray([
            super.hashCode,
            CORE_HASH_STRUCTURE.DATA_PRODUCT_MODEL_ACCESS_POINT_GROUP,
            this.mapping.path,
            hashArray(this.featuredElements ?? []),
            hashArray(this.diagrams),
        ]);
    }
}
export class V1_NativeModelExecutionContext {
    key;
    mapping;
    runtime;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_NATIVE_MODEL_EXECUTION_CONTEXT,
            this.key,
            this.mapping.path,
            this.runtime?.path ?? '',
        ]);
    }
}
export class V1_NativeModelAccess {
    featuredElements;
    nativeModelExecutionContexts;
    defaultExecutionContext;
    diagrams;
    sampleQueries;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_NATIVE_MODEL_ACCESS,
            hashArray(this.nativeModelExecutionContexts),
            hashArray(this.featuredElements ?? []),
            hashArray(this.diagrams ?? []),
            hashArray(this.sampleQueries ?? []),
            this.defaultExecutionContext,
        ]);
    }
}
export class V1_SampleQuery {
    id;
    title;
    description;
    executionContextKey;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_SAMPLE_QUERY,
            this.id,
            this.title,
            this.description ?? '',
            this.executionContextKey ?? '',
        ]);
    }
}
export class V1_InLineSampleQuery extends V1_SampleQuery {
    query;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_INLINE_SAMPLE_QUERY,
            super.hashCode,
            this.query,
        ]);
    }
}
export class V1_PackageableElementSampleQuery extends V1_SampleQuery {
    query;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_PACKAGEABLE_ELEMENT_SAMPLE_QUERY,
            super.hashCode,
            this.query.path,
        ]);
    }
}
export var V1_DeliveryFrequency;
(function (V1_DeliveryFrequency) {
    V1_DeliveryFrequency["DAILY"] = "DAILY";
    V1_DeliveryFrequency["WEEKLY"] = "WEEKLY";
    V1_DeliveryFrequency["MONTHLY"] = "MONTHLY";
    V1_DeliveryFrequency["QUARTERLY"] = "QUARTERLY";
    V1_DeliveryFrequency["YEARLY"] = "YEARLY";
    V1_DeliveryFrequency["ON_DEMAND"] = "ON_DEMAND";
    V1_DeliveryFrequency["INTRA_DAY"] = "INTRADAY";
})(V1_DeliveryFrequency || (V1_DeliveryFrequency = {}));
export var V1_DataProductRegion;
(function (V1_DataProductRegion) {
    V1_DataProductRegion["APAC"] = "APAC";
    V1_DataProductRegion["EMEA"] = "EMEA";
    V1_DataProductRegion["LAMR"] = "LAMR";
    V1_DataProductRegion["NAMR"] = "NAMR";
})(V1_DataProductRegion || (V1_DataProductRegion = {}));
export class V1_DataProductIcon {
}
export class V1_DataProductLibraryIcon extends V1_DataProductIcon {
    libraryId;
    iconId;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_ICON_LIBRARY,
            this.libraryId,
            this.iconId,
        ]);
    }
}
export class V1_DataProductEmbeddedImageIcon extends V1_DataProductIcon {
    imageUrl; // base64 encoded image content
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_ICON_EMBEDDED_IMAGE,
            this.imageUrl,
        ]);
    }
}
// handle incoming icons not yet modeled
export class V1_UnknownDataProductIcon extends V1_DataProductIcon {
    content;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.INTERNAL__UNKNOWN_DATA_PRODUCT_ICON,
            hashObjectWithoutSourceInformation(this.content),
        ]);
    }
}
export class V1_DataProductType {
    get hashCode() {
        return hashArray([CORE_HASH_STRUCTURE.DATA_PRODUCT_TYPE]);
    }
}
export class V1_InternalDataProductType extends V1_DataProductType {
}
export class V1_ExternalDataProductType extends V1_DataProductType {
    link;
    get hashCode() {
        return hashArray([CORE_HASH_STRUCTURE.DATA_PRODUCT_TYPE, this.link]);
    }
}
export class V1_Expertise {
    uuid = uuid();
    description;
    expertIds;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_EXPERTISE,
            this.description ?? '',
            hashArray(this.expertIds ?? []),
        ]);
    }
}
export class V1_DataProductOperationalMetadata {
    coverageRegions;
    updateFrequency;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_OPERATIONAL_METADATA,
            hashArray(this.coverageRegions ?? []),
            this.updateFrequency ?? '',
        ]);
    }
}
export var V1_DataProductOwnerType;
(function (V1_DataProductOwnerType) {
    V1_DataProductOwnerType["APP_DIR"] = "appDir";
})(V1_DataProductOwnerType || (V1_DataProductOwnerType = {}));
export class V1_DataProductOwner {
}
export class V1_AppDirOwner extends V1_DataProductOwner {
    production;
    prodParallel;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT_OWNER,
            this.production?.hashCode ?? '',
            this.prodParallel?.hashCode ?? '',
        ]);
    }
}
export class V1_DataProduct extends V1_PackageableElement {
    title;
    description;
    icon;
    accessPointGroups = [];
    nativeModelAccess;
    supportInfo;
    type;
    stereotypes = [];
    taggedValues = [];
    sampleValues;
    operationalMetadata;
    owner;
    testSuites;
    get hashCode() {
        return hashArray([
            CORE_HASH_STRUCTURE.DATA_PRODUCT,
            this.title ?? '',
            this.description ?? '',
            this.icon ?? '',
            hashArray(this.accessPointGroups),
            this.nativeModelAccess ?? '',
            this.supportInfo ?? '',
            this.type ?? '',
            hashArray(this.stereotypes),
            hashArray(this.taggedValues),
            hashArray(this.sampleValues ?? []),
            this.operationalMetadata ?? '',
            this.owner ?? '',
            hashArray(this.testSuites ?? []),
        ]);
    }
    accept_PackageableElementVisitor(visitor) {
        return visitor.visit_DataProduct(this);
    }
}
//# sourceMappingURL=V1_DataProduct.js.map