All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlan.model.mesh.DataProductAssetsDSL Maven / Gradle / Ivy

// Generated by delombok at Thu Oct 10 18:56:32 UTC 2024
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2022 Atlan Pte. Ltd. */
package com.atlan.model.mesh;

import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import com.atlan.model.core.AtlanObject;
import com.atlan.model.search.IndexSearchDSL;
import com.atlan.model.search.IndexSearchRequest;
import java.util.List;
import lombok.*;

/**
 * Class from which to configure the assets that should be selected for a data product.
 */
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = DataProductAssetsDSL.DataProductAssetsDSLBuilderImpl.class)
public class DataProductAssetsDSL extends AtlanObject {
    private static final long serialVersionUID = 2L;
    private static final List ATTR_LIST = List.of("__traitNames", "connectorName", "__customAttributes", "certificateStatus", "tenantId", "anchor", "parentQualifiedName", "Query.parentQualifiedName", "AtlasGlossaryTerm.anchor", "databaseName", "schemaName", "parent", "connectionQualifiedName", "collectionQualifiedName", "announcementMessage", "announcementTitle", "announcementType", "announcementUpdatedAt", "announcementUpdatedBy", "allowQuery", "allowQueryPreview", "adminGroups", "adminRoles", "adminUsers", "category", "credentialStrategy", "connectionSSOCredentialGuid", "certificateStatus", "certificateUpdatedAt", "certificateUpdatedBy", "classifications", "connectionId", "connectionQualifiedName", "connectorName", "dataType", "defaultDatabaseQualifiedName", "defaultSchemaQualifiedName", "description", "displayName", "links", "link", "meanings", "name", "ownerGroups", "ownerUsers", "qualifiedName", "typeName", "userDescription", "displayDescription", "subDataType", "rowLimit", "queryTimeout", "previewCredentialStrategy", "policyStrategy", "policyStrategyForSamplePreview", "useObjectStorage", "objectStorageUploadThreshold", "outputPortDataProducts");

    /**
     * Build a search using the provided query and default options.
     *
     * @param query the query to use for the search
     * @return the search request, with default options
     */
    public static DataProductAssetsDSLBuilder builder(Query query) {
        return builder(IndexSearchDSL.of(query));
    }

    /**
     * Build a search using the provided index search DSL and default options.
     *
     * @param dsl containing the query to use for the search
     * @return the search request, with default options
     */
    public static DataProductAssetsDSLBuilder builder(IndexSearchDSL dsl) {
        // TODO: Ideally we can remove this wrapping eventually
        Query q = dsl.getQuery();
        FilterQuery.Builder builder = new FilterQuery.Builder();
        Query wrapped = builder.filter(q).build()._toQuery();
        return DataProductAssetsDSL._internal().query(IndexSearchRequest.builder(dsl.toBuilder().query(wrapped).size(null).trackTotalHits(null).build()).requestMetadata(null).showSearchScore(null).excludeAtlanTags(null).excludeMeanings(null).allowDeletedRelations(null).attributes(ATTR_LIST).build());
    }

    /**
     * Parameters for the search itself.
     */
    IndexSearchRequest query;
    /**
     * Whether or not to filter scrubbed records.
     */
    Boolean filterScrubbed;

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    private static Boolean $default$filterScrubbed() {
        return true;
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class DataProductAssetsDSLBuilder> extends AtlanObject.AtlanObjectBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private IndexSearchRequest query;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private boolean filterScrubbed$set;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private Boolean filterScrubbed$value;

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected B $fillValuesFrom(final C instance) {
            super.$fillValuesFrom(instance);
            DataProductAssetsDSL.DataProductAssetsDSLBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
            return self();
        }

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final DataProductAssetsDSL instance, final DataProductAssetsDSL.DataProductAssetsDSLBuilder b) {
            b.query(instance.query);
            b.filterScrubbed(instance.filterScrubbed);
        }

        /**
         * Parameters for the search itself.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B query(final IndexSearchRequest query) {
            this.query = query;
            return self();
        }

        /**
         * Whether or not to filter scrubbed records.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B filterScrubbed(final Boolean filterScrubbed) {
            this.filterScrubbed$value = filterScrubbed;
            filterScrubbed$set = true;
            return self();
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected abstract B self();

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public abstract C build();

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public java.lang.String toString() {
            return "DataProductAssetsDSL.DataProductAssetsDSLBuilder(super=" + super.toString() + ", query=" + this.query + ", filterScrubbed$value=" + this.filterScrubbed$value + ")";
        }
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "", buildMethodName = "build")
    static final class DataProductAssetsDSLBuilderImpl extends DataProductAssetsDSL.DataProductAssetsDSLBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private DataProductAssetsDSLBuilderImpl() {
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected DataProductAssetsDSL.DataProductAssetsDSLBuilderImpl self() {
            return this;
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public DataProductAssetsDSL build() {
            return new DataProductAssetsDSL(this);
        }
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected DataProductAssetsDSL(final DataProductAssetsDSL.DataProductAssetsDSLBuilder b) {
        super(b);
        this.query = b.query;
        if (b.filterScrubbed$set) this.filterScrubbed = b.filterScrubbed$value;
         else this.filterScrubbed = DataProductAssetsDSL.$default$filterScrubbed();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static DataProductAssetsDSL.DataProductAssetsDSLBuilder _internal() {
        return new DataProductAssetsDSL.DataProductAssetsDSLBuilderImpl();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public DataProductAssetsDSL.DataProductAssetsDSLBuilder toBuilder() {
        return new DataProductAssetsDSL.DataProductAssetsDSLBuilderImpl().$fillValuesFrom(this);
    }

    /**
     * Parameters for the search itself.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public IndexSearchRequest getQuery() {
        return this.query;
    }

    /**
     * Whether or not to filter scrubbed records.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public Boolean getFilterScrubbed() {
        return this.filterScrubbed;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof DataProductAssetsDSL)) return false;
        final DataProductAssetsDSL other = (DataProductAssetsDSL) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (!super.equals(o)) return false;
        final java.lang.Object this$filterScrubbed = this.getFilterScrubbed();
        final java.lang.Object other$filterScrubbed = other.getFilterScrubbed();
        if (this$filterScrubbed == null ? other$filterScrubbed != null : !this$filterScrubbed.equals(other$filterScrubbed)) return false;
        final java.lang.Object this$query = this.getQuery();
        final java.lang.Object other$query = other.getQuery();
        if (this$query == null ? other$query != null : !this$query.equals(other$query)) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof DataProductAssetsDSL;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final java.lang.Object $filterScrubbed = this.getFilterScrubbed();
        result = result * PRIME + ($filterScrubbed == null ? 43 : $filterScrubbed.hashCode());
        final java.lang.Object $query = this.getQuery();
        result = result * PRIME + ($query == null ? 43 : $query.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "DataProductAssetsDSL(super=" + super.toString() + ", query=" + this.getQuery() + ", filterScrubbed=" + this.getFilterScrubbed() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy