diff --git a/integration-tests/src/test/java/com/atlan/java/sdk/CustomAssetTest.java b/integration-tests/src/test/java/com/atlan/java/sdk/CustomAssetTest.java index f103751fae..ccb205ca42 100644 --- a/integration-tests/src/test/java/com/atlan/java/sdk/CustomAssetTest.java +++ b/integration-tests/src/test/java/com/atlan/java/sdk/CustomAssetTest.java @@ -27,10 +27,14 @@ public class CustomAssetTest extends AtlanLiveTest { public static final AtlanConnectorType CONNECTOR_TYPE = AtlanConnectorType.CUSTOM; public static final String CONNECTION_NAME = PREFIX; - private static final String ENTITY_NAME = PREFIX + "-entity"; + private static final String PARENT_NAME = PREFIX + "-parent"; + private static final String CHILD_NAME1 = PREFIX + "-child1"; + private static final String CHILD_NAME2 = PREFIX + "-child2"; private static Connection connection = null; - private static CustomEntity entity = null; + private static CustomEntity parent = null; + private static CustomEntity child1 = null; + private static CustomEntity child2 = null; @Test(groups = {"custom.create.connection"}) void createConnection() throws AtlanException, InterruptedException { @@ -38,33 +42,73 @@ void createConnection() throws AtlanException, InterruptedException { } @Test( - groups = {"custom.create.entity"}, + groups = {"custom.create.parent"}, dependsOnGroups = {"custom.create.connection"}) - void createEntity() throws AtlanException { - CustomEntity toCreate = - CustomEntity.creator(ENTITY_NAME, connection.getQualifiedName()).build(); + void createParent() throws AtlanException { + CustomEntity toCreate = CustomEntity.creator(PARENT_NAME, connection.getQualifiedName()) + .iconUrl("http://assets.atlan.com/assets/ph-bowl-food-light.svg") + .subType("Fruit Salad") + .build(); AssetMutationResponse response = toCreate.save(client); Asset one = validateSingleCreate(response); assertTrue(one instanceof CustomEntity); - entity = (CustomEntity) one; - assertNotNull(entity.getGuid()); - assertNotNull(entity.getQualifiedName()); - assertEquals(entity.getName(), ENTITY_NAME); - assertEquals(entity.getConnectorType(), CONNECTOR_TYPE); - assertEquals(entity.getConnectionQualifiedName(), connection.getQualifiedName()); + parent = (CustomEntity) one; + assertNotNull(parent.getGuid()); + assertNotNull(parent.getQualifiedName()); + assertEquals(parent.getName(), PARENT_NAME); + assertEquals(parent.getConnectorType(), CONNECTOR_TYPE); + assertEquals(parent.getConnectionQualifiedName(), connection.getQualifiedName()); } @Test( - groups = {"custom.update.entity"}, - dependsOnGroups = {"custom.create.entity"}) - void updateEntity() throws AtlanException { + groups = {"custom.create.children"}, + dependsOnGroups = {"custom.create.parent"}) + void createChildren() throws AtlanException { + CustomEntity one = CustomEntity.creator(CHILD_NAME1, connection.getQualifiedName()) + .iconUrl("http://assets.atlan.com/assets/ph-apple-logo-light.svg") + .subType("Apple") + .customParentEntity(CustomEntity.refByGuid(parent.getGuid())) + .build(); + CustomEntity two = CustomEntity.creator(CHILD_NAME2, connection.getQualifiedName()) + .iconUrl("http://assets.atlan.com/assets/ph-orange-slice-light.svg") + .subType("Orange") + .customParentEntity(CustomEntity.refByQualifiedName(parent.getQualifiedName())) + .customRelatedToEntity(CustomEntity.refByGuid(one.getGuid())) + .build(); + AssetMutationResponse response = client.assets.save(List.of(one, two), false); + assertNotNull(response); + assertNotNull(response.getUpdatedAssets()); + assertEquals(response.getUpdatedAssets().size(), 1); + assertEquals(response.getUpdatedAssets().get(0).getGuid(), parent.getGuid()); + assertNotNull(response.getCreatedAssets()); + assertEquals(response.getCreatedAssets().size(), 2); + for (Asset asset : response.getCreatedAssets()) { + assertTrue(asset instanceof CustomEntity); + assertNotNull(asset.getGuid()); + assertNotNull(asset.getQualifiedName()); + assertEquals(asset.getConnectorType(), CONNECTOR_TYPE); + assertEquals(asset.getConnectionQualifiedName(), connection.getQualifiedName()); + if (asset.getName().equals(CHILD_NAME1)) { + child1 = (CustomEntity) asset; + } else if (asset.getName().equals(CHILD_NAME2)) { + child2 = (CustomEntity) asset; + } else { + throw new IllegalStateException("Created entity did not match either we attempted to create."); + } + } + } + + @Test( + groups = {"custom.update.parent"}, + dependsOnGroups = {"custom.create.*"}) + void updateParent() throws AtlanException { CustomEntity updated = CustomEntity.updateCertificate( - client, entity.getQualifiedName(), CERTIFICATE_STATUS, CERTIFICATE_MESSAGE); + client, parent.getQualifiedName(), CERTIFICATE_STATUS, CERTIFICATE_MESSAGE); assertNotNull(updated); assertEquals(updated.getCertificateStatus(), CERTIFICATE_STATUS); assertEquals(updated.getCertificateStatusMessage(), CERTIFICATE_MESSAGE); updated = CustomEntity.updateAnnouncement( - client, entity.getQualifiedName(), ANNOUNCEMENT_TYPE, ANNOUNCEMENT_TITLE, ANNOUNCEMENT_MESSAGE); + client, parent.getQualifiedName(), ANNOUNCEMENT_TYPE, ANNOUNCEMENT_TITLE, ANNOUNCEMENT_MESSAGE); assertNotNull(updated); assertEquals(updated.getAnnouncementType(), ANNOUNCEMENT_TYPE); assertEquals(updated.getAnnouncementTitle(), ANNOUNCEMENT_TITLE); @@ -72,21 +116,46 @@ void updateEntity() throws AtlanException { } @Test( - groups = {"custom.read.entity"}, - dependsOnGroups = {"custom.create.*", "custom.update.entity"}) - void retrieveEntity() throws AtlanException { - CustomEntity c = CustomEntity.get(client, entity.getGuid(), true); + groups = {"custom.read.parent"}, + dependsOnGroups = {"custom.create.*", "custom.update.parent"}) + void retrieveParent() throws AtlanException { + CustomEntity c = CustomEntity.get(client, parent.getGuid(), true); assertNotNull(c); assertTrue(c.isComplete()); - assertEquals(c.getGuid(), entity.getGuid()); - assertEquals(c.getQualifiedName(), entity.getQualifiedName()); - assertEquals(c.getName(), ENTITY_NAME); + assertEquals(c.getGuid(), parent.getGuid()); + assertEquals(c.getQualifiedName(), parent.getQualifiedName()); + assertEquals(c.getName(), PARENT_NAME); assertEquals(c.getCertificateStatus(), CERTIFICATE_STATUS); + assertEquals(c.getCustomChildEntities().size(), 2); + assertEquals(c.getSubType(), "Fruit Salad"); + assertEquals(c.getIconUrl(), "http://assets.atlan.com/assets/ph-bowl-food-light.svg"); + } + + @Test( + groups = {"custom.read.child1"}, + dependsOnGroups = {"custom.create.*", "custom.update.parent"}) + void retrieveChild1() throws AtlanException { + CustomEntity c = CustomEntity.get(client, child1.getGuid(), true); + assertNotNull(c); + assertTrue(c.isComplete()); + assertEquals(c.getGuid(), child1.getGuid()); + assertEquals(c.getQualifiedName(), child1.getQualifiedName()); + assertEquals(c.getName(), CHILD_NAME1); + assertTrue( + c.getCustomChildEntities() == null || c.getCustomChildEntities().isEmpty()); + assertNotNull(c.getCustomParentEntity()); + assertEquals(c.getCustomParentEntity().getGuid(), parent.getGuid()); + assertFalse(c.getCustomRelatedFromEntities() == null + || c.getCustomRelatedFromEntities().isEmpty()); + assertEquals(c.getCustomRelatedFromEntities().size(), 1); + assertEquals(c.getCustomRelatedFromEntities().first().getGuid(), child2.getGuid()); + assertEquals(c.getSubType(), "Apple"); + assertEquals(c.getIconUrl(), "http://assets.atlan.com/assets/ph-apple-logo-light.svg"); } @Test( groups = {"custom.search.assets"}, - dependsOnGroups = {"custom.read.entity"}) + dependsOnGroups = {"custom.read.*"}) void searchAssets() throws AtlanException, InterruptedException { IndexSearchRequest index = client.assets .select() @@ -95,11 +164,12 @@ void searchAssets() throws AtlanException, InterruptedException { .pageSize(10) .aggregate("type", IReferenceable.TYPE_NAME.bucketBy()) .sort(Asset.CREATE_TIME.order(SortOrder.Asc)) + .sort(Asset.NAME.order(SortOrder.Asc)) .includeOnResults(Asset.NAME) .includeOnResults(Asset.CONNECTION_QUALIFIED_NAME) .toRequest(); - IndexSearchResponse response = retrySearchUntil(index, 9L); + IndexSearchResponse response = retrySearchUntil(index, 3L); assertNotNull(response.getAggregations()); assertEquals(response.getAggregations().size(), 1); @@ -108,7 +178,7 @@ void searchAssets() throws AtlanException, InterruptedException { ((AggregationBucketResult) response.getAggregations().get("type")) .getBuckets() .size(), - 3); + 1); assertEquals(response.getApproximateCount().longValue(), 3L); List entities = response.getAssets(); @@ -119,16 +189,32 @@ void searchAssets() throws AtlanException, InterruptedException { assertTrue(one instanceof CustomEntity); assertFalse(one.isComplete()); CustomEntity d = (CustomEntity) one; - assertEquals(d.getQualifiedName(), entity.getQualifiedName()); - assertEquals(d.getName(), entity.getName()); + assertEquals(d.getQualifiedName(), parent.getQualifiedName()); + assertEquals(d.getName(), parent.getName()); + assertEquals(d.getConnectionQualifiedName(), connection.getQualifiedName()); + + one = entities.get(1); + assertTrue(one instanceof CustomEntity); + assertFalse(one.isComplete()); + d = (CustomEntity) one; + assertEquals(d.getQualifiedName(), child1.getQualifiedName()); + assertEquals(d.getName(), child1.getName()); + assertEquals(d.getConnectionQualifiedName(), connection.getQualifiedName()); + + one = entities.get(2); + assertTrue(one instanceof CustomEntity); + assertFalse(one.isComplete()); + d = (CustomEntity) one; + assertEquals(d.getQualifiedName(), child2.getQualifiedName()); + assertEquals(d.getName(), child2.getName()); assertEquals(d.getConnectionQualifiedName(), connection.getQualifiedName()); } @Test( - groups = {"custom.delete.entity"}, + groups = {"custom.delete.child2"}, dependsOnGroups = {"custom.update.*", "custom.search.*"}) - void deleteEntity() throws AtlanException { - AssetMutationResponse response = Asset.delete(client, entity.getGuid()).block(); + void deleteChild2() throws AtlanException { + AssetMutationResponse response = Asset.delete(client, child2.getGuid()).block(); assertNotNull(response); assertTrue(response.getCreatedAssets().isEmpty()); assertTrue(response.getUpdatedAssets().isEmpty()); @@ -136,36 +222,36 @@ void deleteEntity() throws AtlanException { Asset one = response.getDeletedAssets().get(0); assertTrue(one instanceof CustomEntity); CustomEntity s = (CustomEntity) one; - assertEquals(s.getGuid(), entity.getGuid()); - assertEquals(s.getQualifiedName(), entity.getQualifiedName()); + assertEquals(s.getGuid(), child2.getGuid()); + assertEquals(s.getQualifiedName(), child2.getQualifiedName()); assertEquals(s.getDeleteHandler(), "SOFT"); assertEquals(s.getStatus(), AtlanStatus.DELETED); } @Test( - groups = {"custom.delete.entity.read"}, - dependsOnGroups = {"custom.delete.entity"}) + groups = {"custom.delete.child2.read"}, + dependsOnGroups = {"custom.delete.child2"}) void readDeletedEntity() throws AtlanException { - validateDeletedAsset(entity, log); + validateDeletedAsset(child2, log); } @Test( - groups = {"custom.delete.entity.restore"}, - dependsOnGroups = {"custom.delete.entity.read"}) + groups = {"custom.delete.child2.restore"}, + dependsOnGroups = {"custom.delete.child2.read"}) void restoreEntity() throws AtlanException { - assertTrue(CustomEntity.restore(client, entity.getQualifiedName())); - CustomEntity restored = CustomEntity.get(client, entity.getQualifiedName()); + assertTrue(CustomEntity.restore(client, child2.getQualifiedName())); + CustomEntity restored = CustomEntity.get(client, child2.getQualifiedName()); assertFalse(restored.isComplete()); - assertEquals(restored.getGuid(), entity.getGuid()); - assertEquals(restored.getQualifiedName(), entity.getQualifiedName()); + assertEquals(restored.getGuid(), child2.getGuid()); + assertEquals(restored.getQualifiedName(), child2.getQualifiedName()); assertEquals(restored.getStatus(), AtlanStatus.ACTIVE); } @Test( - groups = {"custom.purge.entity"}, - dependsOnGroups = {"custom.delete.entity.restore"}) + groups = {"custom.purge.child2"}, + dependsOnGroups = {"custom.delete.child2.restore"}) void purgeEntity() throws AtlanException { - AssetMutationResponse response = Asset.purge(client, entity.getGuid()).block(); + AssetMutationResponse response = Asset.purge(client, child2.getGuid()).block(); assertNotNull(response); assertTrue(response.getCreatedAssets().isEmpty()); assertTrue(response.getUpdatedAssets().isEmpty()); @@ -173,8 +259,8 @@ void purgeEntity() throws AtlanException { Asset one = response.getDeletedAssets().get(0); assertTrue(one instanceof CustomEntity); CustomEntity s = (CustomEntity) one; - assertEquals(s.getGuid(), entity.getGuid()); - assertEquals(s.getQualifiedName(), entity.getQualifiedName()); + assertEquals(s.getGuid(), child2.getGuid()); + assertEquals(s.getQualifiedName(), child2.getQualifiedName()); assertEquals(s.getDeleteHandler(), "PURGE"); assertEquals(s.getStatus(), AtlanStatus.DELETED); } @@ -186,7 +272,7 @@ void purgeEntity() throws AtlanException { "custom.read.*", "custom.search.*", "custom.update.*", - "custom.purge.entity" + "custom.purge.child2" }, alwaysRun = true) void purgeConnection() throws AtlanException, InterruptedException { diff --git a/integration-tests/src/test/java/com/atlan/java/sdk/DataverseAssetTest.java b/integration-tests/src/test/java/com/atlan/java/sdk/DataverseAssetTest.java index 83cd9780b7..563146ad52 100644 --- a/integration-tests/src/test/java/com/atlan/java/sdk/DataverseAssetTest.java +++ b/integration-tests/src/test/java/com/atlan/java/sdk/DataverseAssetTest.java @@ -134,7 +134,7 @@ void searchAssets() throws AtlanException, InterruptedException { .includeOnResults(Asset.CONNECTION_QUALIFIED_NAME) .toRequest(); - IndexSearchResponse response = retrySearchUntil(index, 9L); + IndexSearchResponse response = retrySearchUntil(index, 2L); assertNotNull(response.getAggregations()); assertEquals(response.getAggregations().size(), 1); @@ -143,12 +143,12 @@ void searchAssets() throws AtlanException, InterruptedException { ((AggregationBucketResult) response.getAggregations().get("type")) .getBuckets() .size(), - 9); + 2); - assertEquals(response.getApproximateCount().longValue(), 9L); + assertEquals(response.getApproximateCount().longValue(), 2L); List entities = response.getAssets(); assertNotNull(entities); - assertEquals(entities.size(), 9); + assertEquals(entities.size(), 2); Asset one = entities.get(0); assertTrue(one instanceof DataverseEntity); diff --git a/sdk/src/main/java/com/atlan/model/assets/Asset.java b/sdk/src/main/java/com/atlan/model/assets/Asset.java index 5c1ead1338..e51d60d69f 100644 --- a/sdk/src/main/java/com/atlan/model/assets/Asset.java +++ b/sdk/src/main/java/com/atlan/model/assets/Asset.java @@ -798,6 +798,9 @@ public abstract class Asset extends Reference implements IAsset, IReferenceable @Singular SortedSet viewerUsers; + /** URL of an icon to use for this asset. (Only applies to CustomEntity and Fivetran Catalog assets, currently.) */ + transient String iconUrl; + /** Internal tracking of fields that should be serialized with null values. */ @JsonIgnore @Singular diff --git a/sdk/src/main/java/com/atlan/model/assets/DataverseAttribute.java b/sdk/src/main/java/com/atlan/model/assets/DataverseAttribute.java index 54ec7cf977..bfe97618b3 100644 --- a/sdk/src/main/java/com/atlan/model/assets/DataverseAttribute.java +++ b/sdk/src/main/java/com/atlan/model/assets/DataverseAttribute.java @@ -361,10 +361,10 @@ public static boolean restore(AtlanClient client, String qualifiedName) throws A /** * Builds the minimal object necessary to create a DataverseAttribute. * - * @param name of the DataverseAttribute - * @param entity in which DataverseAttribute should be created, which must have at least + * @param name of the attribute + * @param entity in which the attribute should be created, which must have at least * a qualifiedName - * @return the minimal request necessary to create the DataverseAttribute, as a builder + * @return the minimal request necessary to create the attribute, as a builder * @throws InvalidRequestException if the entity provided is without a qualifiedName */ public static DataverseAttribute.DataverseAttributeBuilder creator(String name, DataverseEntity entity) @@ -381,7 +381,7 @@ public static boolean restore(AtlanClient client, String qualifiedName) throws A /** * Builds the minimal object necessary to create a DataverseAttribute. * - * @param name of the DataverseAttribute + * @param name of the attribute * @param entityQualifiedName unique name of the entity in which this attribute exists * @return the minimal request necessary to create the attribute, as a builder */ @@ -394,7 +394,7 @@ public static boolean restore(AtlanClient client, String qualifiedName) throws A /** * Builds the minimal object necessary to create a DataverseAttribute. * - * @param name of the DataverseAttribute + * @param name of the attribute * @param connectionQualifiedName unique name of the connection in which to create the attribute * @param entityQualifiedName unique name of the entity in which to create the attribute * @return the minimal request necessary to create the attribute, as a builder diff --git a/sdk/src/main/java/com/atlan/model/assets/DataverseEntity.java b/sdk/src/main/java/com/atlan/model/assets/DataverseEntity.java index 7e376b07a6..2ee72bdad2 100644 --- a/sdk/src/main/java/com/atlan/model/assets/DataverseEntity.java +++ b/sdk/src/main/java/com/atlan/model/assets/DataverseEntity.java @@ -348,11 +348,11 @@ public static boolean restore(AtlanClient client, String qualifiedName) throws A } /** - * Builds the minimal object necessary to create a DataverseEntity. + * Builds the minimal object necessary to create a Dataverse entity. * - * @param name of the DataverseEntity - * @param connectionQualifiedName unique name of the connection through which the DataverseEntity is accessible - * @return the minimal object necessary to create the DataverseEntity, as a builder + * @param name of the Dataverse entity + * @param connectionQualifiedName unique name of the connection through which the entity is accessible + * @return the minimal object necessary to create the Dataverse entity, as a builder */ public static DataverseEntity.DataverseEntityBuilder creator(String name, String connectionQualifiedName) { return DataverseEntity._internal() diff --git a/sdk/src/main/java/com/atlan/model/assets/ICatalog.java b/sdk/src/main/java/com/atlan/model/assets/ICatalog.java index 634960d1a8..ed6485f29c 100644 --- a/sdk/src/main/java/com/atlan/model/assets/ICatalog.java +++ b/sdk/src/main/java/com/atlan/model/assets/ICatalog.java @@ -467,6 +467,9 @@ public static ICatalog getLineageReference(String typeName, String qualifiedName case PowerBIDataflow.TYPE_NAME: ref = PowerBIDataflow.refByQualifiedName(qualifiedName); break; + case PowerBIDataflowEntityColumn.TYPE_NAME: + ref = PowerBIDataflowEntityColumn.refByQualifiedName(qualifiedName); + break; case PowerBIDataset.TYPE_NAME: ref = PowerBIDataset.refByQualifiedName(qualifiedName); break; diff --git a/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflow.java b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflow.java index 4f3ed957f4..0be583196c 100644 --- a/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflow.java +++ b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflow.java @@ -40,6 +40,9 @@ public interface IPowerBIDataflow { /** Child Dataflows to this PowerBI Dataflow. */ RelationField POWER_BI_DATAFLOW_CHILDREN = new RelationField("powerBIDataflowChildren"); + /** PowerBI Dataflow Entity Columns that exist within this Dataflow. */ + RelationField POWER_BI_DATAFLOW_ENTITY_COLUMNS = new RelationField("powerBIDataflowEntityColumns"); + /** Parent Dataflows to this PowerBI Dataflow. */ RelationField POWER_BI_DATAFLOW_PARENTS = new RelationField("powerBIDataflowParents"); @@ -55,6 +58,9 @@ public interface IPowerBIDataflow { KeywordField POWER_BI_DATAFLOW_REFRESH_SCHEDULE_TIMES = new KeywordField("powerBIDataflowRefreshScheduleTimes", "powerBIDataflowRefreshScheduleTimes"); + /** PowerBI Datasources that are associated with this Dataflow. */ + RelationField POWER_BI_DATASOURCES = new RelationField("powerBIDatasources"); + /** Lineage process that associates this PowerBI Dataflow. */ RelationField POWER_BI_PROCESSES = new RelationField("powerBIProcesses"); @@ -472,6 +478,9 @@ public interface IPowerBIDataflow { /** Child Dataflows to this PowerBI Dataflow. */ SortedSet getPowerBIDataflowChildren(); + /** PowerBI Dataflow Entity Columns that exist within this Dataflow. */ + SortedSet getPowerBIDataflowEntityColumns(); + /** Parent Dataflows to this PowerBI Dataflow. */ SortedSet getPowerBIDataflowParents(); @@ -484,6 +493,9 @@ public interface IPowerBIDataflow { /** Time for the refresh schedule set for a PowerBI Dataflow. */ SortedSet getPowerBIDataflowRefreshScheduleTimes(); + /** PowerBI Datasources that are associated with this Dataflow. */ + SortedSet getPowerBIDatasources(); + /** Endorsement status of this asset, in Power BI. */ PowerBIEndorsementType getPowerBIEndorsement(); diff --git a/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflowEntityColumn.java b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflowEntityColumn.java new file mode 100644 index 0000000000..ee4ccdf2cf --- /dev/null +++ b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDataflowEntityColumn.java @@ -0,0 +1,639 @@ +/* SPDX-License-Identifier: Apache-2.0 + Copyright 2023 Atlan Pte. Ltd. */ +package com.atlan.model.assets; + +import com.atlan.model.enums.AtlanAnnouncementType; +import com.atlan.model.enums.AtlanConnectorType; +import com.atlan.model.enums.AtlanIcon; +import com.atlan.model.enums.AtlanStatus; +import com.atlan.model.enums.CertificateStatus; +import com.atlan.model.enums.PowerBIEndorsementType; +import com.atlan.model.enums.SourceCostUnitType; +import com.atlan.model.fields.KeywordField; +import com.atlan.model.fields.RelationField; +import com.atlan.model.fields.TextField; +import com.atlan.model.relations.RelationshipAttributes; +import com.atlan.model.relations.UniqueAttributes; +import com.atlan.model.structs.PopularityInsights; +import com.atlan.model.structs.StarredDetails; +import com.atlan.serde.AssetDeserializer; +import com.atlan.serde.AssetSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.List; +import java.util.SortedSet; +import javax.annotation.processing.Generated; + +/** + * Instance of a Power BI Dataflow Entity Column in Atlan. Dataflows are reusable transformation logic that can be shared by many datasets and reports inside Power BI. Each Dataflow has an Entity which represents an instance of SQL data from source, that has columns associated with it. + */ +@Generated(value = "com.atlan.generators.ModelGeneratorV2") +@JsonSerialize(using = AssetSerializer.class) +@JsonDeserialize(using = AssetDeserializer.class) +public interface IPowerBIDataflowEntityColumn { + + public static final String TYPE_NAME = "PowerBIDataflowEntityColumn"; + + /** PowerBI Dataflow in which this Dataflow Entity Column exists. */ + RelationField POWER_BI_DATAFLOW = new RelationField("powerBIDataflow"); + + /** Data type of this dataflow entity column. */ + KeywordField POWER_BI_DATAFLOW_ENTITY_COLUMN_DATA_TYPE = + new KeywordField("powerBIDataflowEntityColumnDataType", "powerBIDataflowEntityColumnDataType"); + + /** Unique name of the dataflow entity in which this dataflow entity column exists. */ + TextField POWER_BI_DATAFLOW_ENTITY_NAME = new TextField("powerBIDataflowEntityName", "powerBIDataflowEntityName"); + + /** Unique name of the dataflow in which this dataflow entity column exists. */ + KeywordField POWER_BI_DATAFLOW_QUALIFIED_NAME = + new KeywordField("powerBIDataflowQualifiedName", "powerBIDataflowQualifiedName"); + + /** Unique name of the workspace in which this dataflow entity column exists. */ + KeywordField POWER_BI_WORKSPACE_QUALIFIED_NAME = + new KeywordField("powerBIWorkspaceQualifiedName", "powerBIWorkspaceQualifiedName"); + + /** List of groups who administer this asset. (This is only used for certain asset types.) */ + SortedSet getAdminGroups(); + + /** List of roles who administer this asset. (This is only used for Connection assets.) */ + SortedSet getAdminRoles(); + + /** List of users who administer this asset. (This is only used for certain asset types.) */ + SortedSet getAdminUsers(); + + /** Detailed message to include in the announcement on this asset. */ + String getAnnouncementMessage(); + + /** Brief title for the announcement on this asset. Required when announcementType is specified. */ + String getAnnouncementTitle(); + + /** Type of announcement on this asset. */ + AtlanAnnouncementType getAnnouncementType(); + + /** Time (epoch) at which the announcement was last updated, in milliseconds. */ + Long getAnnouncementUpdatedAt(); + + /** Name of the user who last updated the announcement. */ + String getAnnouncementUpdatedBy(); + + /** Checks that run on this asset. */ + SortedSet getAnomaloChecks(); + + /** Application asset containing this Asset. */ + IApplication getApplication(); + + /** Qualified name of the Application that contains this asset. */ + String getApplicationQualifiedName(); + + /** All associated Anomalo check types. */ + SortedSet getAssetAnomaloAppliedCheckTypes(); + + /** Total number of checks present in Anomalo for this asset. */ + Long getAssetAnomaloCheckCount(); + + /** Stringified JSON object containing status of all Anomalo checks associated to this asset. */ + String getAssetAnomaloCheckStatuses(); + + /** Status of data quality from Anomalo. */ + String getAssetAnomaloDQStatus(); + + /** Total number of checks failed in Anomalo for this asset. */ + Long getAssetAnomaloFailedCheckCount(); + + /** All associated Anomalo failed check types. */ + SortedSet getAssetAnomaloFailedCheckTypes(); + + /** Time (epoch) at which the last check was run via Anomalo. */ + Long getAssetAnomaloLastCheckRunAt(); + + /** URL of the source in Anomalo. */ + String getAssetAnomaloSourceUrl(); + + /** TBC */ + String getAssetCoverImage(); + + /** Name of the account in which this asset exists in dbt. */ + String getAssetDbtAccountName(); + + /** Alias of this asset in dbt. */ + String getAssetDbtAlias(); + + /** Version of the environment in which this asset is materialized in dbt. */ + String getAssetDbtEnvironmentDbtVersion(); + + /** Name of the environment in which this asset is materialized in dbt. */ + String getAssetDbtEnvironmentName(); + + /** Time (epoch) at which the job that materialized this asset in dbt last ran, in milliseconds. */ + Long getAssetDbtJobLastRun(); + + /** Path in S3 to the artifacts saved from the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunArtifactS3Path(); + + /** Whether artifacts were saved from the last run of the job that materialized this asset in dbt (true) or not (false). */ + Boolean getAssetDbtJobLastRunArtifactsSaved(); + + /** Time (epoch) at which the job that materialized this asset in dbt was last created, in milliseconds. */ + Long getAssetDbtJobLastRunCreatedAt(); + + /** Time (epoch) at which the job that materialized this asset in dbt was dequeued, in milliseconds. */ + Long getAssetDbtJobLastRunDequedAt(); + + /** Thread ID of the user who executed the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunExecutedByThreadId(); + + /** Branch in git from which the last run of the job that materialized this asset in dbt ran. */ + String getAssetDbtJobLastRunGitBranch(); + + /** SHA hash in git for the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunGitSha(); + + /** Whether docs were generated from the last run of the job that materialized this asset in dbt (true) or not (false). */ + Boolean getAssetDbtJobLastRunHasDocsGenerated(); + + /** Whether sources were generated from the last run of the job that materialized this asset in dbt (true) or not (false). */ + Boolean getAssetDbtJobLastRunHasSourcesGenerated(); + + /** Whether notifications were sent from the last run of the job that materialized this asset in dbt (true) or not (false). */ + Boolean getAssetDbtJobLastRunNotificationsSent(); + + /** Thread ID of the owner of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunOwnerThreadId(); + + /** Total duration the job that materialized this asset in dbt spent being queued. */ + String getAssetDbtJobLastRunQueuedDuration(); + + /** Human-readable total duration of the last run of the job that materialized this asset in dbt spend being queued. */ + String getAssetDbtJobLastRunQueuedDurationHumanized(); + + /** Run duration of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunRunDuration(); + + /** Human-readable run duration of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunRunDurationHumanized(); + + /** Time (epoch) at which the job that materialized this asset in dbt was started running, in milliseconds. */ + Long getAssetDbtJobLastRunStartedAt(); + + /** Status message of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunStatusMessage(); + + /** Total duration of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunTotalDuration(); + + /** Human-readable total duration of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunTotalDurationHumanized(); + + /** Time (epoch) at which the job that materialized this asset in dbt was last updated, in milliseconds. */ + Long getAssetDbtJobLastRunUpdatedAt(); + + /** URL of the last run of the job that materialized this asset in dbt. */ + String getAssetDbtJobLastRunUrl(); + + /** Name of the job that materialized this asset in dbt. */ + String getAssetDbtJobName(); + + /** Time (epoch) when the next run of the job that materializes this asset in dbt is scheduled. */ + Long getAssetDbtJobNextRun(); + + /** Human-readable time when the next run of the job that materializes this asset in dbt is scheduled. */ + String getAssetDbtJobNextRunHumanized(); + + /** Schedule of the job that materialized this asset in dbt. */ + String getAssetDbtJobSchedule(); + + /** Human-readable cron schedule of the job that materialized this asset in dbt. */ + String getAssetDbtJobScheduleCronHumanized(); + + /** Status of the job that materialized this asset in dbt. */ + String getAssetDbtJobStatus(); + + /** Metadata for this asset in dbt, specifically everything under the 'meta' key in the dbt object. */ + String getAssetDbtMeta(); + + /** Name of the package in which this asset exists in dbt. */ + String getAssetDbtPackageName(); + + /** Name of the project in which this asset exists in dbt. */ + String getAssetDbtProjectName(); + + /** URL of the semantic layer proxy for this asset in dbt. */ + String getAssetDbtSemanticLayerProxyUrl(); + + /** Freshness criteria for the source of this asset in dbt. */ + String getAssetDbtSourceFreshnessCriteria(); + + /** List of tags attached to this asset in dbt. */ + SortedSet getAssetDbtTags(); + + /** All associated dbt test statuses. */ + String getAssetDbtTestStatus(); + + /** Unique identifier of this asset in dbt. */ + String getAssetDbtUniqueId(); + + /** Name of the DBT workflow in Atlan that last updated the asset. */ + String getAssetDbtWorkflowLastUpdated(); + + /** Name of the icon to use for this asset. (Only applies to glossaries, currently.) */ + AtlanIcon getAssetIcon(); + + /** List of unique Monte Carlo alert names attached to this asset. */ + SortedSet getAssetMcAlertQualifiedNames(); + + /** List of Monte Carlo incident names attached to this asset. */ + SortedSet getAssetMcIncidentNames(); + + /** List of Monte Carlo incident priorities associated with this asset. */ + SortedSet getAssetMcIncidentPriorities(); + + /** List of unique Monte Carlo incident names attached to this asset. */ + SortedSet getAssetMcIncidentQualifiedNames(); + + /** List of Monte Carlo incident severities associated with this asset. */ + SortedSet getAssetMcIncidentSeverities(); + + /** List of Monte Carlo incident states associated with this asset. */ + SortedSet getAssetMcIncidentStates(); + + /** List of Monte Carlo incident sub-types associated with this asset. */ + SortedSet getAssetMcIncidentSubTypes(); + + /** List of Monte Carlo incident types associated with this asset. */ + SortedSet getAssetMcIncidentTypes(); + + /** Tracks whether this asset is monitored by MC or not */ + Boolean getAssetMcIsMonitored(); + + /** Time (epoch) at which this asset was last synced from Monte Carlo. */ + Long getAssetMcLastSyncRunAt(); + + /** List of Monte Carlo monitor names attached to this asset. */ + SortedSet getAssetMcMonitorNames(); + + /** List of unique Monte Carlo monitor names attached to this asset. */ + SortedSet getAssetMcMonitorQualifiedNames(); + + /** Schedules of all associated Monte Carlo monitors. */ + SortedSet getAssetMcMonitorScheduleTypes(); + + /** Statuses of all associated Monte Carlo monitors. */ + SortedSet getAssetMcMonitorStatuses(); + + /** Types of all associated Monte Carlo monitors. */ + SortedSet getAssetMcMonitorTypes(); + + /** Count of policies inside the asset */ + Long getAssetPoliciesCount(); + + /** Array of policy ids governing this asset */ + SortedSet getAssetPolicyGUIDs(); + + /** Number of checks done via Soda. */ + Long getAssetSodaCheckCount(); + + /** All associated Soda check statuses. */ + String getAssetSodaCheckStatuses(); + + /** Status of data quality from Soda. */ + String getAssetSodaDQStatus(); + + /** TBC */ + Long getAssetSodaLastScanAt(); + + /** TBC */ + Long getAssetSodaLastSyncRunAt(); + + /** TBC */ + String getAssetSodaSourceURL(); + + /** List of tags attached to this asset. */ + SortedSet getAssetTags(); + + /** Color (in hexadecimal RGB) to use to represent this asset. */ + String getAssetThemeHex(); + + /** Glossary terms that are linked to this asset. */ + SortedSet getAssignedTerms(); + + /** Status of this asset's certification. */ + CertificateStatus getCertificateStatus(); + + /** Human-readable descriptive message used to provide further detail to certificateStatus. */ + String getCertificateStatusMessage(); + + /** Time (epoch) at which the certification was last updated, in milliseconds. */ + Long getCertificateUpdatedAt(); + + /** Name of the user who last updated the certification of this asset. */ + String getCertificateUpdatedBy(); + + /** Simple name of the connection through which this asset is accessible. */ + String getConnectionName(); + + /** Unique name of the connection through which this asset is accessible. */ + String getConnectionQualifiedName(); + + /** Type of the connector through which this asset is accessible. */ + AtlanConnectorType getConnectorType(); + + /** Latest version of the data contract (in any status) for this asset. */ + IDataContract getDataContractLatest(); + + /** Latest certified version of the data contract for this asset. */ + IDataContract getDataContractLatestCertified(); + + /** Unique name of this asset in dbt. */ + String getDbtQualifiedName(); + + /** Description of this asset, for example as crawled from a source. Fallback for display purposes, if userDescription is empty. */ + String getDescription(); + + /** Human-readable name of this asset used for display purposes (in user interface). */ + String getDisplayName(); + + /** Array of domain guids linked to this asset */ + SortedSet getDomainGUIDs(); + + /** TBC */ + SortedSet getFiles(); + + /** Whether this asset has contract (true) or not (false). */ + Boolean getHasContract(); + + /** Whether this asset has lineage (true) or not (false). */ + Boolean getHasLineage(); + + /** Data products for which this asset is an input port. */ + SortedSet getInputPortDataProducts(); + + /** Tasks to which this asset provides input. */ + SortedSet getInputToAirflowTasks(); + + /** Processes to which this asset provides input. */ + SortedSet getInputToProcesses(); + + /** TBC */ + SortedSet getInputToSparkJobs(); + + /** TBC */ + Boolean getIsAIGenerated(); + + /** Whether this asset is discoverable through the UI (true) or not (false). */ + Boolean getIsDiscoverable(); + + /** Whether this asset can be edited in the UI (true) or not (false). */ + Boolean getIsEditable(); + + /** TBC */ + Boolean getIsPartial(); + + /** Time (epoch) of the last operation that inserted, updated, or deleted rows, in milliseconds. */ + Long getLastRowChangedAt(); + + /** Name of the last run of the crawler that last synchronized this asset. */ + String getLastSyncRun(); + + /** Time (epoch) at which this asset was last crawled, in milliseconds. */ + Long getLastSyncRunAt(); + + /** Name of the crawler that last synchronized this asset. */ + String getLastSyncWorkflowName(); + + /** Custom order for sorting purpose, managed by client */ + String getLexicographicalSortOrder(); + + /** Links that are attached to this asset. */ + SortedSet getLinks(); + + /** TBC */ + SortedSet getMcIncidents(); + + /** Monitors that observe this asset. */ + SortedSet getMcMonitors(); + + /** TBC */ + SortedSet getMetrics(); + + /** Attributes implemented by this asset. */ + SortedSet getModelImplementedAttributes(); + + /** Entities implemented by this asset. */ + SortedSet getModelImplementedEntities(); + + /** Name of this asset. Fallback for display purposes, if displayName is empty. */ + String getName(); + + /** Array of policy ids non-compliant to this asset */ + SortedSet getNonCompliantAssetPolicyGUIDs(); + + /** Tasks from which this asset is output. */ + SortedSet getOutputFromAirflowTasks(); + + /** Processes from which this asset is produced as output. */ + SortedSet getOutputFromProcesses(); + + /** TBC */ + SortedSet getOutputFromSparkJobs(); + + /** Data products for which this asset is an output port. */ + SortedSet getOutputPortDataProducts(); + + /** List of groups who own this asset. */ + SortedSet getOwnerGroups(); + + /** List of users who own this asset. */ + SortedSet getOwnerUsers(); + + /** Popularity score for this asset. */ + Double getPopularityScore(); + + /** PowerBI Dataflow in which this Dataflow Entity Column exists. */ + IPowerBIDataflow getPowerBIDataflow(); + + /** Data type of this dataflow entity column. */ + String getPowerBIDataflowEntityColumnDataType(); + + /** Unique name of the dataflow entity in which this dataflow entity column exists. */ + String getPowerBIDataflowEntityName(); + + /** Unique name of the dataflow in which this dataflow entity column exists. */ + String getPowerBIDataflowQualifiedName(); + + /** Endorsement status of this asset, in Power BI. */ + PowerBIEndorsementType getPowerBIEndorsement(); + + /** Format of this asset, as specified in the FORMAT_STRING of the MDX cell property. */ + String getPowerBIFormatString(); + + /** Whether this asset is hidden in Power BI (true) or not (false). */ + Boolean getPowerBIIsHidden(); + + /** Unique name of the Power BI table in which this asset exists. */ + String getPowerBITableQualifiedName(); + + /** Unique name of the workspace in which this dataflow entity column exists. */ + String getPowerBIWorkspaceQualifiedName(); + + /** Unique name for this asset. This is typically a concatenation of the asset's name onto its parent's qualifiedName. This must be unique across all assets of the same type. */ + String getQualifiedName(); + + /** README that is linked to this asset. */ + IReadme getReadme(); + + /** URL for sample data for this asset. */ + String getSampleDataUrl(); + + /** TBC */ + SortedSet getSchemaRegistrySubjects(); + + /** TBC */ + SortedSet getSodaChecks(); + + /** The unit of measure for sourceTotalCost. */ + SourceCostUnitType getSourceCostUnit(); + + /** Time (epoch) at which this asset was created in the source system, in milliseconds. */ + Long getSourceCreatedAt(); + + /** Name of the user who created this asset, in the source system. */ + String getSourceCreatedBy(); + + /** URL to create an embed for a resource (for example, an image of a dashboard) within Atlan. */ + String getSourceEmbedURL(); + + /** Timestamp of most recent read operation. */ + Long getSourceLastReadAt(); + + /** List of owners of this asset, in the source system. */ + String getSourceOwners(); + + /** List of most expensive warehouses with extra insights. */ + List getSourceQueryComputeCostRecords(); + + /** List of most expensive warehouse names. */ + SortedSet getSourceQueryComputeCosts(); + + /** Total count of all read operations at source. */ + Long getSourceReadCount(); + + /** List of the most expensive queries that accessed this asset. */ + List getSourceReadExpensiveQueryRecords(); + + /** List of the most popular queries that accessed this asset. */ + List getSourceReadPopularQueryRecords(); + + /** Total cost of read queries at source. */ + Double getSourceReadQueryCost(); + + /** List of usernames with extra insights for the most recent users who read this asset. */ + List getSourceReadRecentUserRecords(); + + /** List of usernames of the most recent users who read this asset. */ + SortedSet getSourceReadRecentUsers(); + + /** List of the slowest queries that accessed this asset. */ + List getSourceReadSlowQueryRecords(); + + /** List of usernames with extra insights for the users who read this asset the most. */ + List getSourceReadTopUserRecords(); + + /** List of usernames of the users who read this asset the most. */ + SortedSet getSourceReadTopUsers(); + + /** Total number of unique users that read data from asset. */ + Long getSourceReadUserCount(); + + /** Total cost of all operations at source. */ + Double getSourceTotalCost(); + + /** URL to the resource within the source application, used to create a button to view this asset in the source application. */ + String getSourceURL(); + + /** Time (epoch) at which this asset was last updated in the source system, in milliseconds. */ + Long getSourceUpdatedAt(); + + /** Name of the user who last updated this asset, in the source system. */ + String getSourceUpdatedBy(); + + /** Users who have starred this asset. */ + SortedSet getStarredBy(); + + /** Number of users who have starred this asset. */ + Integer getStarredCount(); + + /** List of usernames with extra information of the users who have starred an asset. */ + List getStarredDetails(); + + /** Subtype of this asset. */ + String getSubType(); + + /** Name of the Atlan workspace in which this asset exists. */ + String getTenantId(); + + /** TBC */ + SortedSet getUserDefRelationshipFroms(); + + /** TBC */ + SortedSet getUserDefRelationshipTos(); + + /** Description of this asset, as provided by a user. If present, this will be used for the description in user interface. */ + String getUserDescription(); + + /** View score for this asset. */ + Double getViewScore(); + + /** List of groups who can view assets contained in a collection. (This is only used for certain asset types.) */ + SortedSet getViewerGroups(); + + /** List of users who can view assets contained in a collection. (This is only used for certain asset types.) */ + SortedSet getViewerUsers(); + + /** Name of the type that defines the asset. */ + String getTypeName(); + + /** Globally-unique identifier for the asset. */ + String getGuid(); + + /** Human-readable name of the asset. */ + String getDisplayText(); + + /** Status of the asset (if this is a related asset). */ + String getEntityStatus(); + + /** Type of the relationship (if this is a related asset). */ + String getRelationshipType(); + + /** Unique identifier of the relationship (when this is a related asset). */ + String getRelationshipGuid(); + + /** Status of the relationship (when this is a related asset). */ + AtlanStatus getRelationshipStatus(); + + /** Attributes specific to the relationship (unused). */ + RelationshipAttributes getRelationshipAttributes(); + + /** + * Attribute(s) that uniquely identify the asset (when this is a related asset). + * If the guid is not provided, these must be provided. + */ + UniqueAttributes getUniqueAttributes(); + + /** + * When true, indicates that this object represents a complete view of the entity. + * When false, this object is only a reference or some partial view of the entity. + */ + boolean isComplete(); + + /** + * Indicates whether this object can be used as a valid reference by GUID. + * @return true if it is a valid GUID reference, false otherwise + */ + boolean isValidReferenceByGuid(); + + /** + * Indicates whether this object can be used as a valid reference by qualifiedName. + * @return true if it is a valid qualifiedName reference, false otherwise + */ + boolean isValidReferenceByQualifiedName(); +} diff --git a/sdk/src/main/java/com/atlan/model/assets/IPowerBIDatasource.java b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDatasource.java index d19bc2a570..5fe4841783 100644 --- a/sdk/src/main/java/com/atlan/model/assets/IPowerBIDatasource.java +++ b/sdk/src/main/java/com/atlan/model/assets/IPowerBIDatasource.java @@ -40,6 +40,9 @@ public interface IPowerBIDatasource { /** Datasets created by this datasource. */ RelationField DATASETS = new RelationField("datasets"); + /** PowerBI Dataflows that are associated with this PowerBI Datasource. */ + RelationField POWER_BI_DATAFLOWS = new RelationField("powerBIDataflows"); + /** List of groups who administer this asset. (This is only used for certain asset types.) */ SortedSet getAdminGroups(); @@ -442,6 +445,9 @@ public interface IPowerBIDatasource { /** Popularity score for this asset. */ Double getPopularityScore(); + /** PowerBI Dataflows that are associated with this PowerBI Datasource. */ + SortedSet getPowerBIDataflows(); + /** Endorsement status of this asset, in Power BI. */ PowerBIEndorsementType getPowerBIEndorsement(); diff --git a/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflow.java b/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflow.java index 6045835588..cbffc1b9d0 100644 --- a/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflow.java +++ b/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflow.java @@ -99,6 +99,11 @@ public class PowerBIDataflow extends Asset @Singular SortedSet powerBIDataflowChildren; + /** PowerBI Dataflow Entity Columns that exist within this Dataflow. */ + @Attribute + @Singular + SortedSet powerBIDataflowEntityColumns; + /** Parent Dataflows to this PowerBI Dataflow. */ @Attribute @Singular @@ -117,6 +122,11 @@ public class PowerBIDataflow extends Asset @Singular SortedSet powerBIDataflowRefreshScheduleTimes; + /** PowerBI Datasources that are associated with this Dataflow. */ + @Attribute + @Singular + SortedSet powerBIDatasources; + /** Endorsement status of this asset, in Power BI. */ @Attribute PowerBIEndorsementType powerBIEndorsement; diff --git a/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflowEntityColumn.java b/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflowEntityColumn.java new file mode 100644 index 0000000000..a4a5f5cf59 --- /dev/null +++ b/sdk/src/main/java/com/atlan/model/assets/PowerBIDataflowEntityColumn.java @@ -0,0 +1,607 @@ +/* SPDX-License-Identifier: Apache-2.0 + Copyright 2022 Atlan Pte. Ltd. */ +package com.atlan.model.assets; + +import com.atlan.AtlanClient; +import com.atlan.exception.AtlanException; +import com.atlan.exception.ErrorCode; +import com.atlan.exception.InvalidRequestException; +import com.atlan.exception.NotFoundException; +import com.atlan.model.enums.AtlanAnnouncementType; +import com.atlan.model.enums.CertificateStatus; +import com.atlan.model.enums.PowerBIEndorsementType; +import com.atlan.model.fields.AtlanField; +import com.atlan.model.relations.Reference; +import com.atlan.model.relations.UniqueAttributes; +import com.atlan.model.search.FluentSearch; +import com.atlan.util.StringUtils; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.SortedSet; +import java.util.concurrent.ThreadLocalRandom; +import javax.annotation.processing.Generated; +import lombok.*; +import lombok.experimental.SuperBuilder; +import lombok.extern.slf4j.Slf4j; + +/** + * Instance of a Power BI Dataflow Entity Column in Atlan. Dataflows are reusable transformation logic that can be shared by many datasets and reports inside Power BI. Each Dataflow has an Entity which represents an instance of SQL data from source, that has columns associated with it. + */ +@Generated(value = "com.atlan.generators.ModelGeneratorV2") +@Getter +@SuperBuilder(toBuilder = true, builderMethodName = "_internal") +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Slf4j +public class PowerBIDataflowEntityColumn extends Asset + implements IPowerBIDataflowEntityColumn, IPowerBI, IBI, ICatalog, IAsset, IReferenceable { + private static final long serialVersionUID = 2L; + + public static final String TYPE_NAME = "PowerBIDataflowEntityColumn"; + + /** Fixed typeName for PowerBIDataflowEntityColumns. */ + @Getter(onMethod_ = {@Override}) + @Builder.Default + String typeName = TYPE_NAME; + + /** Tasks to which this asset provides input. */ + @Attribute + @Singular + SortedSet inputToAirflowTasks; + + /** Processes to which this asset provides input. */ + @Attribute + @Singular + SortedSet inputToProcesses; + + /** TBC */ + @Attribute + @Singular + SortedSet inputToSparkJobs; + + /** Attributes implemented by this asset. */ + @Attribute + @Singular + SortedSet modelImplementedAttributes; + + /** Entities implemented by this asset. */ + @Attribute + @Singular + SortedSet modelImplementedEntities; + + /** Tasks from which this asset is output. */ + @Attribute + @Singular + SortedSet outputFromAirflowTasks; + + /** Processes from which this asset is produced as output. */ + @Attribute + @Singular + SortedSet outputFromProcesses; + + /** TBC */ + @Attribute + @Singular + SortedSet outputFromSparkJobs; + + /** PowerBI Dataflow in which this Dataflow Entity Column exists. */ + @Attribute + IPowerBIDataflow powerBIDataflow; + + /** Data type of this dataflow entity column. */ + @Attribute + String powerBIDataflowEntityColumnDataType; + + /** Unique name of the dataflow entity in which this dataflow entity column exists. */ + @Attribute + String powerBIDataflowEntityName; + + /** Unique name of the dataflow in which this dataflow entity column exists. */ + @Attribute + String powerBIDataflowQualifiedName; + + /** Endorsement status of this asset, in Power BI. */ + @Attribute + PowerBIEndorsementType powerBIEndorsement; + + /** Format of this asset, as specified in the FORMAT_STRING of the MDX cell property. */ + @Attribute + String powerBIFormatString; + + /** Whether this asset is hidden in Power BI (true) or not (false). */ + @Attribute + Boolean powerBIIsHidden; + + /** Unique name of the Power BI table in which this asset exists. */ + @Attribute + String powerBITableQualifiedName; + + /** Unique name of the workspace in which this dataflow entity column exists. */ + @Attribute + String powerBIWorkspaceQualifiedName; + + /** + * Builds the minimal object necessary to create a relationship to a PowerBIDataflowEntityColumn, from a potentially + * more-complete PowerBIDataflowEntityColumn object. + * + * @return the minimal object necessary to relate to the PowerBIDataflowEntityColumn + * @throws InvalidRequestException if any of the minimal set of required properties for a PowerBIDataflowEntityColumn relationship are not found in the initial object + */ + @Override + public PowerBIDataflowEntityColumn trimToReference() throws InvalidRequestException { + if (this.getGuid() != null && !this.getGuid().isEmpty()) { + return refByGuid(this.getGuid()); + } + if (this.getQualifiedName() != null && !this.getQualifiedName().isEmpty()) { + return refByQualifiedName(this.getQualifiedName()); + } + if (this.getUniqueAttributes() != null + && this.getUniqueAttributes().getQualifiedName() != null + && !this.getUniqueAttributes().getQualifiedName().isEmpty()) { + return refByQualifiedName(this.getUniqueAttributes().getQualifiedName()); + } + throw new InvalidRequestException( + ErrorCode.MISSING_REQUIRED_RELATIONSHIP_PARAM, TYPE_NAME, "guid, qualifiedName"); + } + + /** + * Start a fluent search that will return all PowerBIDataflowEntityColumn assets. + * Additional conditions can be chained onto the returned search before any + * asset retrieval is attempted, ensuring all conditions are pushed-down for + * optimal retrieval. Only active (non-archived) PowerBIDataflowEntityColumn assets will be included. + * + * @param client connectivity to the Atlan tenant from which to retrieve the assets + * @return a fluent search that includes all PowerBIDataflowEntityColumn assets + */ + public static FluentSearch.FluentSearchBuilder select(AtlanClient client) { + return select(client, false); + } + + /** + * Start a fluent search that will return all PowerBIDataflowEntityColumn assets. + * Additional conditions can be chained onto the returned search before any + * asset retrieval is attempted, ensuring all conditions are pushed-down for + * optimal retrieval. + * + * @param client connectivity to the Atlan tenant from which to retrieve the assets + * @param includeArchived when true, archived (soft-deleted) PowerBIDataflowEntityColumns will be included + * @return a fluent search that includes all PowerBIDataflowEntityColumn assets + */ + public static FluentSearch.FluentSearchBuilder select(AtlanClient client, boolean includeArchived) { + FluentSearch.FluentSearchBuilder builder = + FluentSearch.builder(client).where(Asset.TYPE_NAME.eq(TYPE_NAME)); + if (!includeArchived) { + builder.active(); + } + return builder; + } + + /** + * Reference to a PowerBIDataflowEntityColumn by GUID. Use this to create a relationship to this PowerBIDataflowEntityColumn, + * where the relationship should be replaced. + * + * @param guid the GUID of the PowerBIDataflowEntityColumn to reference + * @return reference to a PowerBIDataflowEntityColumn that can be used for defining a relationship to a PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn refByGuid(String guid) { + return refByGuid(guid, Reference.SaveSemantic.REPLACE); + } + + /** + * Reference to a PowerBIDataflowEntityColumn by GUID. Use this to create a relationship to this PowerBIDataflowEntityColumn, + * where you want to further control how that relationship should be updated (i.e. replaced, + * appended, or removed). + * + * @param guid the GUID of the PowerBIDataflowEntityColumn to reference + * @param semantic how to save this relationship (replace all with this, append it, or remove it) + * @return reference to a PowerBIDataflowEntityColumn that can be used for defining a relationship to a PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn refByGuid(String guid, Reference.SaveSemantic semantic) { + return PowerBIDataflowEntityColumn._internal() + .guid(guid) + .semantic(semantic) + .build(); + } + + /** + * Reference to a PowerBIDataflowEntityColumn by qualifiedName. Use this to create a relationship to this PowerBIDataflowEntityColumn, + * where the relationship should be replaced. + * + * @param qualifiedName the qualifiedName of the PowerBIDataflowEntityColumn to reference + * @return reference to a PowerBIDataflowEntityColumn that can be used for defining a relationship to a PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn refByQualifiedName(String qualifiedName) { + return refByQualifiedName(qualifiedName, Reference.SaveSemantic.REPLACE); + } + + /** + * Reference to a PowerBIDataflowEntityColumn by qualifiedName. Use this to create a relationship to this PowerBIDataflowEntityColumn, + * where you want to further control how that relationship should be updated (i.e. replaced, + * appended, or removed). + * + * @param qualifiedName the qualifiedName of the PowerBIDataflowEntityColumn to reference + * @param semantic how to save this relationship (replace all with this, append it, or remove it) + * @return reference to a PowerBIDataflowEntityColumn that can be used for defining a relationship to a PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn refByQualifiedName( + String qualifiedName, Reference.SaveSemantic semantic) { + return PowerBIDataflowEntityColumn._internal() + .uniqueAttributes( + UniqueAttributes.builder().qualifiedName(qualifiedName).build()) + .semantic(semantic) + .build(); + } + + /** + * Retrieves a PowerBIDataflowEntityColumn by one of its identifiers, complete with all of its relationships. + * + * @param client connectivity to the Atlan tenant from which to retrieve the asset + * @param id of the PowerBIDataflowEntityColumn to retrieve, either its GUID or its full qualifiedName + * @return the requested full PowerBIDataflowEntityColumn, complete with all of its relationships + * @throws AtlanException on any error during the API invocation, such as the {@link NotFoundException} if the PowerBIDataflowEntityColumn does not exist or the provided GUID is not a PowerBIDataflowEntityColumn + */ + @JsonIgnore + public static PowerBIDataflowEntityColumn get(AtlanClient client, String id) throws AtlanException { + return get(client, id, false); + } + + /** + * Retrieves a PowerBIDataflowEntityColumn by one of its identifiers, optionally complete with all of its relationships. + * + * @param client connectivity to the Atlan tenant from which to retrieve the asset + * @param id of the PowerBIDataflowEntityColumn to retrieve, either its GUID or its full qualifiedName + * @param includeAllRelationships if true, all the asset's relationships will also be retrieved; if false, no relationships will be retrieved + * @return the requested full PowerBIDataflowEntityColumn, optionally complete with all of its relationships + * @throws AtlanException on any error during the API invocation, such as the {@link NotFoundException} if the PowerBIDataflowEntityColumn does not exist or the provided GUID is not a PowerBIDataflowEntityColumn + */ + @JsonIgnore + public static PowerBIDataflowEntityColumn get(AtlanClient client, String id, boolean includeAllRelationships) + throws AtlanException { + if (id == null) { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_GUID, "(null)"); + } else if (StringUtils.isUUID(id)) { + Asset asset = Asset.get(client, id, includeAllRelationships); + if (asset == null) { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_GUID, id); + } else if (asset instanceof PowerBIDataflowEntityColumn) { + return (PowerBIDataflowEntityColumn) asset; + } else { + throw new NotFoundException(ErrorCode.ASSET_NOT_TYPE_REQUESTED, id, TYPE_NAME); + } + } else { + Asset asset = Asset.get(client, TYPE_NAME, id, includeAllRelationships); + if (asset instanceof PowerBIDataflowEntityColumn) { + return (PowerBIDataflowEntityColumn) asset; + } else { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_QN, id, TYPE_NAME); + } + } + } + + /** + * Retrieves a PowerBIDataflowEntityColumn by one of its identifiers, with only the requested attributes (and relationships). + * + * @param client connectivity to the Atlan tenant from which to retrieve the asset + * @param id of the PowerBIDataflowEntityColumn to retrieve, either its GUID or its full qualifiedName + * @param attributes to retrieve for the PowerBIDataflowEntityColumn, including any relationships + * @return the requested PowerBIDataflowEntityColumn, with only its minimal information and the requested attributes (and relationships) + * @throws AtlanException on any error during the API invocation, such as the {@link NotFoundException} if the PowerBIDataflowEntityColumn does not exist or the provided GUID is not a PowerBIDataflowEntityColumn + */ + @JsonIgnore + public static PowerBIDataflowEntityColumn get(AtlanClient client, String id, Collection attributes) + throws AtlanException { + return get(client, id, attributes, Collections.emptyList()); + } + + /** + * Retrieves a PowerBIDataflowEntityColumn by one of its identifiers, with only the requested attributes (and relationships). + * + * @param client connectivity to the Atlan tenant from which to retrieve the asset + * @param id of the PowerBIDataflowEntityColumn to retrieve, either its GUID or its full qualifiedName + * @param attributes to retrieve for the PowerBIDataflowEntityColumn, including any relationships + * @param attributesOnRelated to retrieve on each relationship retrieved for the PowerBIDataflowEntityColumn + * @return the requested PowerBIDataflowEntityColumn, with only its minimal information and the requested attributes (and relationships) + * @throws AtlanException on any error during the API invocation, such as the {@link NotFoundException} if the PowerBIDataflowEntityColumn does not exist or the provided GUID is not a PowerBIDataflowEntityColumn + */ + @JsonIgnore + public static PowerBIDataflowEntityColumn get( + AtlanClient client, + String id, + Collection attributes, + Collection attributesOnRelated) + throws AtlanException { + if (id == null) { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_GUID, "(null)"); + } else if (StringUtils.isUUID(id)) { + Optional asset = PowerBIDataflowEntityColumn.select(client) + .where(PowerBIDataflowEntityColumn.GUID.eq(id)) + .includesOnResults(attributes) + .includesOnRelations(attributesOnRelated) + .pageSize(1) + .stream() + .findFirst(); + if (!asset.isPresent()) { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_GUID, id); + } else if (asset.get() instanceof PowerBIDataflowEntityColumn) { + return (PowerBIDataflowEntityColumn) asset.get(); + } else { + throw new NotFoundException(ErrorCode.ASSET_NOT_TYPE_REQUESTED, id, TYPE_NAME); + } + } else { + Optional asset = PowerBIDataflowEntityColumn.select(client) + .where(PowerBIDataflowEntityColumn.QUALIFIED_NAME.eq(id)) + .includesOnResults(attributes) + .includesOnRelations(attributesOnRelated) + .pageSize(1) + .stream() + .findFirst(); + if (!asset.isPresent()) { + throw new NotFoundException(ErrorCode.ASSET_NOT_FOUND_BY_QN, id, TYPE_NAME); + } else if (asset.get() instanceof PowerBIDataflowEntityColumn) { + return (PowerBIDataflowEntityColumn) asset.get(); + } else { + throw new NotFoundException(ErrorCode.ASSET_NOT_TYPE_REQUESTED, id, TYPE_NAME); + } + } + } + + /** + * Restore the archived (soft-deleted) PowerBIDataflowEntityColumn to active. + * + * @param client connectivity to the Atlan tenant on which to restore the asset + * @param qualifiedName for the PowerBIDataflowEntityColumn + * @return true if the PowerBIDataflowEntityColumn is now active, and false otherwise + * @throws AtlanException on any API problems + */ + public static boolean restore(AtlanClient client, String qualifiedName) throws AtlanException { + return Asset.restore(client, TYPE_NAME, qualifiedName); + } + + /** + * Builds the minimal object necessary to update a PowerBIDataflowEntityColumn. + * + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the minimal request necessary to update the PowerBIDataflowEntityColumn, as a builder + */ + public static PowerBIDataflowEntityColumnBuilder updater(String qualifiedName, String name) { + return PowerBIDataflowEntityColumn._internal() + .guid("-" + ThreadLocalRandom.current().nextLong(0, Long.MAX_VALUE - 1)) + .qualifiedName(qualifiedName) + .name(name); + } + + /** + * Builds the minimal object necessary to apply an update to a PowerBIDataflowEntityColumn, from a potentially + * more-complete PowerBIDataflowEntityColumn object. + * + * @return the minimal object necessary to update the PowerBIDataflowEntityColumn, as a builder + * @throws InvalidRequestException if any of the minimal set of required properties for PowerBIDataflowEntityColumn are not found in the initial object + */ + @Override + public PowerBIDataflowEntityColumnBuilder trimToRequired() throws InvalidRequestException { + Map map = new HashMap<>(); + map.put("qualifiedName", this.getQualifiedName()); + map.put("name", this.getName()); + validateRequired(TYPE_NAME, map); + return updater(this.getQualifiedName(), this.getName()); + } + + /** + * Remove the system description from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant on which to remove the asset's description + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the updated PowerBIDataflowEntityColumn, or null if the removal failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeDescription(AtlanClient client, String qualifiedName, String name) + throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeDescription(client, updater(qualifiedName, name)); + } + + /** + * Remove the user's description from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant on which to remove the asset's description + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the updated PowerBIDataflowEntityColumn, or null if the removal failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeUserDescription( + AtlanClient client, String qualifiedName, String name) throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeUserDescription(client, updater(qualifiedName, name)); + } + + /** + * Remove the owners from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant from which to remove the PowerBIDataflowEntityColumn's owners + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the updated PowerBIDataflowEntityColumn, or null if the removal failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeOwners(AtlanClient client, String qualifiedName, String name) + throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeOwners(client, updater(qualifiedName, name)); + } + + /** + * Update the certificate on a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant on which to update the PowerBIDataflowEntityColumn's certificate + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param certificate to use + * @param message (optional) message, or null if no message + * @return the updated PowerBIDataflowEntityColumn, or null if the update failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn updateCertificate( + AtlanClient client, String qualifiedName, CertificateStatus certificate, String message) + throws AtlanException { + return (PowerBIDataflowEntityColumn) + Asset.updateCertificate(client, _internal(), TYPE_NAME, qualifiedName, certificate, message); + } + + /** + * Remove the certificate from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant from which to remove the PowerBIDataflowEntityColumn's certificate + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the updated PowerBIDataflowEntityColumn, or null if the removal failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeCertificate(AtlanClient client, String qualifiedName, String name) + throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeCertificate(client, updater(qualifiedName, name)); + } + + /** + * Update the announcement on a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant on which to update the PowerBIDataflowEntityColumn's announcement + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param type type of announcement to set + * @param title (optional) title of the announcement to set (or null for no title) + * @param message (optional) message of the announcement to set (or null for no message) + * @return the result of the update, or null if the update failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn updateAnnouncement( + AtlanClient client, String qualifiedName, AtlanAnnouncementType type, String title, String message) + throws AtlanException { + return (PowerBIDataflowEntityColumn) + Asset.updateAnnouncement(client, _internal(), TYPE_NAME, qualifiedName, type, title, message); + } + + /** + * Remove the announcement from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan client from which to remove the PowerBIDataflowEntityColumn's announcement + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param name of the PowerBIDataflowEntityColumn + * @return the updated PowerBIDataflowEntityColumn, or null if the removal failed + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeAnnouncement(AtlanClient client, String qualifiedName, String name) + throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeAnnouncement(client, updater(qualifiedName, name)); + } + + /** + * Replace the terms linked to the PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant on which to replace the PowerBIDataflowEntityColumn's assigned terms + * @param qualifiedName for the PowerBIDataflowEntityColumn + * @param name human-readable name of the PowerBIDataflowEntityColumn + * @param terms the list of terms to replace on the PowerBIDataflowEntityColumn, or null to remove all terms from the PowerBIDataflowEntityColumn + * @return the PowerBIDataflowEntityColumn that was updated (note that it will NOT contain details of the replaced terms) + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn replaceTerms( + AtlanClient client, String qualifiedName, String name, List terms) throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.replaceTerms(client, updater(qualifiedName, name), terms); + } + + /** + * Link additional terms to the PowerBIDataflowEntityColumn, without replacing existing terms linked to the PowerBIDataflowEntityColumn. + * Note: this operation must make two API calls — one to retrieve the PowerBIDataflowEntityColumn's existing terms, + * and a second to append the new terms. + * + * @param client connectivity to the Atlan tenant on which to append terms to the PowerBIDataflowEntityColumn + * @param qualifiedName for the PowerBIDataflowEntityColumn + * @param terms the list of terms to append to the PowerBIDataflowEntityColumn + * @return the PowerBIDataflowEntityColumn that was updated (note that it will NOT contain details of the appended terms) + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn appendTerms( + AtlanClient client, String qualifiedName, List terms) throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.appendTerms(client, TYPE_NAME, qualifiedName, terms); + } + + /** + * Remove terms from a PowerBIDataflowEntityColumn, without replacing all existing terms linked to the PowerBIDataflowEntityColumn. + * Note: this operation must make two API calls — one to retrieve the PowerBIDataflowEntityColumn's existing terms, + * and a second to remove the provided terms. + * + * @param client connectivity to the Atlan tenant from which to remove terms from the PowerBIDataflowEntityColumn + * @param qualifiedName for the PowerBIDataflowEntityColumn + * @param terms the list of terms to remove from the PowerBIDataflowEntityColumn, which must be referenced by GUID + * @return the PowerBIDataflowEntityColumn that was updated (note that it will NOT contain details of the resulting terms) + * @throws AtlanException on any API problems + */ + public static PowerBIDataflowEntityColumn removeTerms( + AtlanClient client, String qualifiedName, List terms) throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.removeTerms(client, TYPE_NAME, qualifiedName, terms); + } + + /** + * Add Atlan tags to a PowerBIDataflowEntityColumn, without replacing existing Atlan tags linked to the PowerBIDataflowEntityColumn. + * Note: this operation must make two API calls — one to retrieve the PowerBIDataflowEntityColumn's existing Atlan tags, + * and a second to append the new Atlan tags. + * + * @param client connectivity to the Atlan tenant on which to append Atlan tags to the PowerBIDataflowEntityColumn + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param atlanTagNames human-readable names of the Atlan tags to add + * @throws AtlanException on any API problems + * @return the updated PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn appendAtlanTags( + AtlanClient client, String qualifiedName, List atlanTagNames) throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.appendAtlanTags(client, TYPE_NAME, qualifiedName, atlanTagNames); + } + + /** + * Add Atlan tags to a PowerBIDataflowEntityColumn, without replacing existing Atlan tags linked to the PowerBIDataflowEntityColumn. + * Note: this operation must make two API calls — one to retrieve the PowerBIDataflowEntityColumn's existing Atlan tags, + * and a second to append the new Atlan tags. + * + * @param client connectivity to the Atlan tenant on which to append Atlan tags to the PowerBIDataflowEntityColumn + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param atlanTagNames human-readable names of the Atlan tags to add + * @param propagate whether to propagate the Atlan tag (true) or not (false) + * @param removePropagationsOnDelete whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (true) or not (false) + * @param restrictLineagePropagation whether to avoid propagating through lineage (true) or do propagate through lineage (false) + * @throws AtlanException on any API problems + * @return the updated PowerBIDataflowEntityColumn + */ + public static PowerBIDataflowEntityColumn appendAtlanTags( + AtlanClient client, + String qualifiedName, + List atlanTagNames, + boolean propagate, + boolean removePropagationsOnDelete, + boolean restrictLineagePropagation) + throws AtlanException { + return (PowerBIDataflowEntityColumn) Asset.appendAtlanTags( + client, + TYPE_NAME, + qualifiedName, + atlanTagNames, + propagate, + removePropagationsOnDelete, + restrictLineagePropagation); + } + + /** + * Remove an Atlan tag from a PowerBIDataflowEntityColumn. + * + * @param client connectivity to the Atlan tenant from which to remove an Atlan tag from a PowerBIDataflowEntityColumn + * @param qualifiedName of the PowerBIDataflowEntityColumn + * @param atlanTagName human-readable name of the Atlan tag to remove + * @throws AtlanException on any API problems, or if the Atlan tag does not exist on the PowerBIDataflowEntityColumn + */ + public static void removeAtlanTag(AtlanClient client, String qualifiedName, String atlanTagName) + throws AtlanException { + Asset.removeAtlanTag(client, TYPE_NAME, qualifiedName, atlanTagName); + } +} diff --git a/sdk/src/main/java/com/atlan/model/assets/PowerBIDatasource.java b/sdk/src/main/java/com/atlan/model/assets/PowerBIDatasource.java index bfcd920e4a..056c314faf 100644 --- a/sdk/src/main/java/com/atlan/model/assets/PowerBIDatasource.java +++ b/sdk/src/main/java/com/atlan/model/assets/PowerBIDatasource.java @@ -100,6 +100,11 @@ public class PowerBIDatasource extends Asset @Singular SortedSet outputFromSparkJobs; + /** PowerBI Dataflows that are associated with this PowerBI Datasource. */ + @Attribute + @Singular + SortedSet powerBIDataflows; + /** Endorsement status of this asset, in Power BI. */ @Attribute PowerBIEndorsementType powerBIEndorsement; diff --git a/sdk/src/main/java/com/atlan/model/typedefs/AttributeDefOptions.java b/sdk/src/main/java/com/atlan/model/typedefs/AttributeDefOptions.java index e7ea52ea6f..84debde150 100644 --- a/sdk/src/main/java/com/atlan/model/typedefs/AttributeDefOptions.java +++ b/sdk/src/main/java/com/atlan/model/typedefs/AttributeDefOptions.java @@ -180,6 +180,7 @@ public class AttributeDefOptions extends AtlanObject { PowerBIColumn.TYPE_NAME, PowerBIDashboard.TYPE_NAME, PowerBIDataflow.TYPE_NAME, + PowerBIDataflowEntityColumn.TYPE_NAME, PowerBIDataset.TYPE_NAME, PowerBIDatasource.TYPE_NAME, PowerBIMeasure.TYPE_NAME, diff --git a/sdk/src/main/java/com/atlan/serde/AssetDeserializer.java b/sdk/src/main/java/com/atlan/serde/AssetDeserializer.java index 77c11690df..d4a0717d12 100644 --- a/sdk/src/main/java/com/atlan/serde/AssetDeserializer.java +++ b/sdk/src/main/java/com/atlan/serde/AssetDeserializer.java @@ -207,13 +207,23 @@ Asset deserialize(JsonNode root, long minimumTime) throws IOException { if (!processedAttributes.contains(deserializeName)) { Method method = ReflectionCache.getSetter(builderClass, deserializeName); if (method != null) { - try { - Object value = Serde.deserialize(client, attributes.get(attrKey), method, deserializeName); - ReflectionCache.setValue(builder, deserializeName, value); - } catch (NoSuchMethodException e) { - throw new IOException("Missing fromValue method for enum.", e); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new IOException("Failed to deserialize through reflection.", e); + if (deserializeName.equals("assetIcon") + && typeName != null + && (typeName.equals("Catalog") || typeName.equals("CustomEntity"))) { + JsonNode value = attributes.get(attrKey); + if (value != null && !value.isNull()) { + builder.iconUrl(value.asText()); + } + } else { + try { + Object value = + Serde.deserialize(client, attributes.get(attrKey), method, deserializeName); + ReflectionCache.setValue(builder, deserializeName, value); + } catch (NoSuchMethodException e) { + throw new IOException("Missing fromValue method for enum.", e); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new IOException("Failed to deserialize through reflection.", e); + } } } else { // If the setter was not found, still retain it for later processing diff --git a/sdk/src/main/java/com/atlan/serde/AssetSerializer.java b/sdk/src/main/java/com/atlan/serde/AssetSerializer.java index e21bf3dacb..3642caa4c6 100644 --- a/sdk/src/main/java/com/atlan/serde/AssetSerializer.java +++ b/sdk/src/main/java/com/atlan/serde/AssetSerializer.java @@ -7,6 +7,7 @@ import com.atlan.exception.AtlanException; import com.atlan.exception.NotFoundException; import com.atlan.model.assets.Asset; +import com.atlan.model.assets.CustomEntity; import com.atlan.model.core.CustomMetadataAttributes; import com.atlan.model.relations.Reference; import com.atlan.util.StringUtils; @@ -201,6 +202,14 @@ public void serialize(Asset asset, JsonGenerator gen, SerializerProvider sp) } } + // If a URL-based icon has been provided, allow that to be used as the assetIcon. + String iconUrl = asset.getIconUrl(); + if (iconUrl != null + && !iconUrl.isEmpty() + && (asset.getTypeName().equals("Catalog") || asset instanceof CustomEntity)) { + attributes.put("assetIcon", iconUrl); + } + } catch (AtlanException e) { throw new IOException(e); } diff --git a/sdk/src/main/resources/templates/Asset.ftl b/sdk/src/main/resources/templates/Asset.ftl index dab83571f6..0f18748289 100644 --- a/sdk/src/main/resources/templates/Asset.ftl +++ b/sdk/src/main/resources/templates/Asset.ftl @@ -1,4 +1,7 @@ <#macro all> + /** URL of an icon to use for this asset. (Only applies to CustomEntity and Fivetran Catalog assets, currently.) */ + transient String iconUrl; + /** Internal tracking of fields that should be serialized with null values. */ @JsonIgnore @Singular diff --git a/sdk/src/main/resources/templates/asset_test.ftl b/sdk/src/main/resources/templates/asset_test.ftl index 1cca39fb20..ec3b33d37e 100644 --- a/sdk/src/main/resources/templates/asset_test.ftl +++ b/sdk/src/main/resources/templates/asset_test.ftl @@ -61,7 +61,11 @@ public class ${className}Test { .build()) <#list testAttributes as testAttribute> <#list testAttribute.values as value> + <#if className == "CustomEntity" && testAttribute.builderMethod == "assetIcon"> + .iconUrl("http://example.com/example-image.png") + <#else> .${testAttribute.builderMethod}(${value}) + .build(); diff --git a/sdk/src/test/java/com/atlan/model/assets/CustomEntityTest.java b/sdk/src/test/java/com/atlan/model/assets/CustomEntityTest.java index fbc5b5dc50..70fe78cf3a 100644 --- a/sdk/src/test/java/com/atlan/model/assets/CustomEntityTest.java +++ b/sdk/src/test/java/com/atlan/model/assets/CustomEntityTest.java @@ -144,7 +144,7 @@ public class CustomEntityTest { .assetDbtTestStatus("String0") .assetDbtUniqueId("String0") .assetDbtWorkflowLastUpdated("String0") - .assetIcon(AtlanIcon.ATLAN_TAG) + .iconUrl("http://example.com/example-image.png") .assetMcAlertQualifiedName("String0") .assetMcAlertQualifiedName("String1") .assetMcIncidentName("String0") diff --git a/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowEntityColumnTest.java b/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowEntityColumnTest.java new file mode 100644 index 0000000000..5f4ce16f3b --- /dev/null +++ b/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowEntityColumnTest.java @@ -0,0 +1,487 @@ +/* SPDX-License-Identifier: Apache-2.0 + Copyright 2022 Atlan Pte. Ltd. */ +package com.atlan.model.assets; + +import static org.testng.Assert.*; + +import com.atlan.mock.MockAtlanTenant; +import com.atlan.model.core.AtlanTag; +import com.atlan.model.core.CustomMetadataAttributes; +import com.atlan.model.enums.*; +import com.atlan.model.structs.*; +import java.io.IOException; +import java.util.*; +import javax.annotation.processing.Generated; +import org.testng.annotations.Test; + +@Generated(value = "com.atlan.generators.ModelGeneratorV2") +@SuppressWarnings("deprecation") +public class PowerBIDataflowEntityColumnTest { + + private static final PowerBIDataflowEntityColumn full = PowerBIDataflowEntityColumn._internal() + .guid("guid") + .displayText("displayText") + .status(AtlanStatus.ACTIVE) + .createdBy("createdBy") + .updatedBy("updatedBy") + .createTime(123456789L) + .updateTime(123456789L) + .isIncomplete(false) + .deleteHandler("SOFT") + .meaningNames(Set.of("meaningName1", "meaningName2")) + .meanings(Set.of( + Meaning.builder() + .termGuid("termGuid1") + .relationGuid("relationGuid1") + .displayText("displayText1") + .confidence(100) + .build(), + Meaning.builder() + .termGuid("termGuid2") + .relationGuid("relationGuid2") + .displayText("displayText2") + .confidence(100) + .build())) + .qualifiedName("qualifiedName") + .atlanTag(AtlanTag.of("String0")) + .atlanTag(AtlanTag.builder().typeName("String1").propagate(false).build()) + .customMetadata( + "String0", + CustomMetadataAttributes.builder() + .attribute("String0", 123.456) + .attribute("String1", true) + .build()) + .customMetadata( + "String1", + CustomMetadataAttributes.builder() + // Note: for equivalency this MUST be a Long (not an Integer), as deserialization + // will always produce a Long + .attribute("String0", 789L) + .attribute("String1", "AnotherString") + .build()) + .powerBIEndorsement(PowerBIEndorsementType.PROMOTED) + .powerBIFormatString("String0") + .powerBIIsHidden(true) + .powerBITableQualifiedName("String0") + .inputToAirflowTask(AirflowTask.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .inputToAirflowTask(AirflowTask.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .inputToProcess(LineageProcess.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .inputToProcess(LineageProcess.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .inputToSparkJob(SparkJob.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .inputToSparkJob(SparkJob.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .modelImplementedAttribute(ModelAttribute.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .modelImplementedAttribute( + ModelAttribute.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .modelImplementedEntity(ModelEntity.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .modelImplementedEntity(ModelEntity.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .outputFromAirflowTask(AirflowTask.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .outputFromAirflowTask(AirflowTask.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .outputFromProcess(LineageProcess.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .outputFromProcess(LineageProcess.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .outputFromSparkJob(SparkJob.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .outputFromSparkJob(SparkJob.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .adminGroup("String0") + .adminGroup("String1") + .adminRole("String0") + .adminRole("String1") + .adminUser("String0") + .adminUser("String1") + .announcementMessage("String0") + .announcementTitle("String0") + .announcementType(AtlanAnnouncementType.INFORMATION) + .announcementUpdatedAt(123456789L) + .announcementUpdatedBy("String0") + .anomaloCheck(AnomaloCheck.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .anomaloCheck(AnomaloCheck.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .application(Application.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .applicationQualifiedName("String0") + .assetAnomaloAppliedCheckType("String0") + .assetAnomaloAppliedCheckType("String1") + .assetAnomaloCheckCount(123456789L) + .assetAnomaloCheckStatuses("String0") + .assetAnomaloDQStatus("String0") + .assetAnomaloFailedCheckCount(123456789L) + .assetAnomaloFailedCheckType("String0") + .assetAnomaloFailedCheckType("String1") + .assetAnomaloLastCheckRunAt(123456789L) + .assetAnomaloSourceUrl("String0") + .assetCoverImage("String0") + .assetDbtAccountName("String0") + .assetDbtAlias("String0") + .assetDbtEnvironmentDbtVersion("String0") + .assetDbtEnvironmentName("String0") + .assetDbtJobLastRun(123456789L) + .assetDbtJobLastRunArtifactS3Path("String0") + .assetDbtJobLastRunArtifactsSaved(true) + .assetDbtJobLastRunCreatedAt(123456789L) + .assetDbtJobLastRunDequedAt(123456789L) + .assetDbtJobLastRunExecutedByThreadId("String0") + .assetDbtJobLastRunGitBranch("String0") + .assetDbtJobLastRunGitSha("String0") + .assetDbtJobLastRunHasDocsGenerated(true) + .assetDbtJobLastRunHasSourcesGenerated(true) + .assetDbtJobLastRunNotificationsSent(true) + .assetDbtJobLastRunOwnerThreadId("String0") + .assetDbtJobLastRunQueuedDuration("String0") + .assetDbtJobLastRunQueuedDurationHumanized("String0") + .assetDbtJobLastRunRunDuration("String0") + .assetDbtJobLastRunRunDurationHumanized("String0") + .assetDbtJobLastRunStartedAt(123456789L) + .assetDbtJobLastRunStatusMessage("String0") + .assetDbtJobLastRunTotalDuration("String0") + .assetDbtJobLastRunTotalDurationHumanized("String0") + .assetDbtJobLastRunUpdatedAt(123456789L) + .assetDbtJobLastRunUrl("String0") + .assetDbtJobName("String0") + .assetDbtJobNextRun(123456789L) + .assetDbtJobNextRunHumanized("String0") + .assetDbtJobSchedule("String0") + .assetDbtJobScheduleCronHumanized("String0") + .assetDbtJobStatus("String0") + .assetDbtMeta("String0") + .assetDbtPackageName("String0") + .assetDbtProjectName("String0") + .assetDbtSemanticLayerProxyUrl("String0") + .assetDbtSourceFreshnessCriteria("String0") + .assetDbtTag("String0") + .assetDbtTag("String1") + .assetDbtTestStatus("String0") + .assetDbtUniqueId("String0") + .assetDbtWorkflowLastUpdated("String0") + .assetIcon(AtlanIcon.ATLAN_TAG) + .assetMcAlertQualifiedName("String0") + .assetMcAlertQualifiedName("String1") + .assetMcIncidentName("String0") + .assetMcIncidentName("String1") + .assetMcIncidentPriority("String0") + .assetMcIncidentPriority("String1") + .assetMcIncidentQualifiedName("String0") + .assetMcIncidentQualifiedName("String1") + .assetMcIncidentSeverity("String0") + .assetMcIncidentSeverity("String1") + .assetMcIncidentState("String0") + .assetMcIncidentState("String1") + .assetMcIncidentSubType("String0") + .assetMcIncidentSubType("String1") + .assetMcIncidentType("String0") + .assetMcIncidentType("String1") + .assetMcIsMonitored(true) + .assetMcLastSyncRunAt(123456789L) + .assetMcMonitorName("String0") + .assetMcMonitorName("String1") + .assetMcMonitorQualifiedName("String0") + .assetMcMonitorQualifiedName("String1") + .assetMcMonitorScheduleType("String0") + .assetMcMonitorScheduleType("String1") + .assetMcMonitorStatus("String0") + .assetMcMonitorStatus("String1") + .assetMcMonitorType("String0") + .assetMcMonitorType("String1") + .assetPoliciesCount(123456789L) + .assetPolicyGUID("String0") + .assetPolicyGUID("String1") + .assetSodaCheckCount(123456789L) + .assetSodaCheckStatuses("String0") + .assetSodaDQStatus("String0") + .assetSodaLastScanAt(123456789L) + .assetSodaLastSyncRunAt(123456789L) + .assetSodaSourceURL("String0") + .assetTag("String0") + .assetTag("String1") + .assetThemeHex("String0") + .assignedTerm(GlossaryTerm.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .assignedTerm(GlossaryTerm.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .certificateStatus(CertificateStatus.DEPRECATED) + .certificateStatusMessage("String0") + .certificateUpdatedAt(123456789L) + .certificateUpdatedBy("String0") + .connectionName("String0") + .connectionQualifiedName("String0") + .connectorType(AtlanConnectorType.SNOWFLAKE) + .dataContractLatest(DataContract.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .dataContractLatestCertified(DataContract.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .dbtQualifiedName("String0") + .description("String0") + .displayName("String0") + .domainGUID("String0") + .domainGUID("String1") + .file(File.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .file(File.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .hasContract(true) + .hasLineage(true) + .inputPortDataProduct(DataProduct.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .inputPortDataProduct(DataProduct.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .isAIGenerated(true) + .isDiscoverable(true) + .isEditable(true) + .isPartial(true) + .lastRowChangedAt(123456789L) + .lastSyncRun("String0") + .lastSyncRunAt(123456789L) + .lastSyncWorkflowName("String0") + .lexicographicalSortOrder("String0") + .link(Link.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .link(Link.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .mcIncident(MCIncident.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .mcIncident(MCIncident.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .mcMonitor(MCMonitor.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .mcMonitor(MCMonitor.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .metric(DbtMetric.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .metric(DbtMetric.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .name("String0") + .nonCompliantAssetPolicyGUID("String0") + .nonCompliantAssetPolicyGUID("String1") + .outputPortDataProduct(DataProduct.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .outputPortDataProduct(DataProduct.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .ownerGroup("String0") + .ownerGroup("String1") + .ownerUser("String0") + .ownerUser("String1") + .popularityScore(123.456) + .readme(Readme.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .sampleDataUrl("String0") + .schemaRegistrySubject(SchemaRegistrySubject.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .schemaRegistrySubject( + SchemaRegistrySubject.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .sodaCheck(SodaCheck.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .sodaCheck(SodaCheck.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .sourceCostUnit(SourceCostUnitType.CREDITS) + .sourceCreatedAt(123456789L) + .sourceCreatedBy("String0") + .sourceEmbedURL("String0") + .sourceLastReadAt(123456789L) + .sourceOwners("String0") + .sourceQueryComputeCostRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceQueryComputeCostRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceQueryComputeCost("String0") + .sourceQueryComputeCost("String1") + .sourceReadCount(123456789L) + .sourceReadExpensiveQueryRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceReadExpensiveQueryRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceReadPopularQueryRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceReadPopularQueryRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceReadQueryCost(123.456) + .sourceReadRecentUserRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceReadRecentUserRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceReadRecentUser("String0") + .sourceReadRecentUser("String1") + .sourceReadSlowQueryRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceReadSlowQueryRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceReadTopUserRecord(PopularityInsights.builder() + .recordUser("String0") + .recordQuery("String0") + .recordQueryDuration(123456789L) + .recordQueryCount(123456789L) + .recordTotalUserCount(123456789L) + .recordComputeCost(123.456) + .recordMaxComputeCost(123.456) + .recordComputeCostUnit(SourceCostUnitType.CREDITS) + .recordLastTimestamp(123456789L) + .recordWarehouse("String0") + .build()) + .sourceReadTopUserRecord(PopularityInsights.builder() + .recordUser("String1") + .recordQuery("String1") + .recordQueryDuration(987654321L) + .recordQueryCount(987654321L) + .recordTotalUserCount(987654321L) + .recordComputeCost(654.321) + .recordMaxComputeCost(654.321) + .recordComputeCostUnit(SourceCostUnitType.BYTES) + .recordLastTimestamp(987654321L) + .recordWarehouse("String1") + .build()) + .sourceReadTopUser("String0") + .sourceReadTopUser("String1") + .sourceReadUserCount(123456789L) + .sourceTotalCost(123.456) + .sourceURL("String0") + .sourceUpdatedAt(123456789L) + .sourceUpdatedBy("String0") + .addStarredBy("String0") + .addStarredBy("String1") + .starredCount(123) + .starredDetail(StarredDetails.builder() + .assetStarredBy("String0") + .assetStarredAt(123456789L) + .build()) + .starredDetail(StarredDetails.builder() + .assetStarredBy("String1") + .assetStarredAt(987654321L) + .build()) + .subType("String0") + .tenantId("String0") + .userDefRelationshipFrom(Task.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .userDefRelationshipFrom(Task.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .userDefRelationshipTo(Task.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .userDefRelationshipTo(Task.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .userDescription("String0") + .viewScore(123.456) + .viewerGroup("String0") + .viewerGroup("String1") + .viewerUser("String0") + .viewerUser("String1") + .powerBIDataflow(PowerBIDataflow.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .powerBIDataflowEntityColumnDataType("String0") + .powerBIDataflowEntityName("String0") + .powerBIDataflowQualifiedName("String0") + .powerBIWorkspaceQualifiedName("String0") + .build(); + + private static final int hash = full.hashCode(); + private static PowerBIDataflowEntityColumn frodo; + private static String serialized; + + @Test(groups = {"PowerBIDataflowEntityColumn.builderEquivalency"}) + void builderEquivalency() { + assertEquals(full.toBuilder().build(), full); + } + + @Test( + groups = {"PowerBIDataflowEntityColumn.serialize"}, + dependsOnGroups = {"PowerBIDataflowEntityColumn.builderEquivalency"}) + void serialization() { + assertNotNull(full); + serialized = full.toJson(MockAtlanTenant.client); + assertNotNull(serialized); + assertEquals(full.hashCode(), hash, "Serialization mutated the original value,"); + } + + @Test( + groups = {"PowerBIDataflowEntityColumn.deserialize"}, + dependsOnGroups = {"PowerBIDataflowEntityColumn.serialize"}) + void deserialization() throws IOException { + assertNotNull(serialized); + frodo = MockAtlanTenant.client.readValue(serialized, PowerBIDataflowEntityColumn.class); + assertNotNull(frodo); + } + + @Test( + groups = {"PowerBIDataflowEntityColumn.equivalency"}, + dependsOnGroups = {"PowerBIDataflowEntityColumn.serialize", "PowerBIDataflowEntityColumn.deserialize"}) + void serializedEquivalency() { + assertNotNull(serialized); + assertNotNull(frodo); + String backAgain = frodo.toJson(MockAtlanTenant.client); + assertEquals(backAgain, serialized, "Serialization is not equivalent after serde loop,"); + } + + @Test( + groups = {"PowerBIDataflowEntityColumn.equivalency"}, + dependsOnGroups = {"PowerBIDataflowEntityColumn.serialize", "PowerBIDataflowEntityColumn.deserialize"}) + void deserializedEquivalency() { + assertNotNull(full); + assertNotNull(frodo); + assertEquals(frodo, full, "Deserialization is not equivalent after serde loop,"); + } +} diff --git a/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowTest.java b/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowTest.java index 914f9cffef..762ccea2f4 100644 --- a/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowTest.java +++ b/sdk/src/test/java/com/atlan/model/assets/PowerBIDataflowTest.java @@ -435,6 +435,9 @@ public class PowerBIDataflowTest { .dataset(PowerBIDataset.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) .powerBIDataflowChild(PowerBIDataflow.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) .powerBIDataflowChild(PowerBIDataflow.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .powerBIDataflowEntityColumn(PowerBIDataflowEntityColumn.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .powerBIDataflowEntityColumn( + PowerBIDataflowEntityColumn.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) .powerBIDataflowParent(PowerBIDataflow.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) .powerBIDataflowParent( PowerBIDataflow.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) @@ -442,6 +445,8 @@ public class PowerBIDataflowTest { .powerBIDataflowRefreshScheduleTimeZone("String0") .powerBIDataflowRefreshScheduleTime("String0") .powerBIDataflowRefreshScheduleTime("String1") + .powerBIDatasource(PowerBIDatasource.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .powerBIDatasource(PowerBIDatasource.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) .powerBIProcess(LineageProcess.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) .powerBIProcess(LineageProcess.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) .table(PowerBITable.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) diff --git a/sdk/src/test/java/com/atlan/model/assets/PowerBIDatasourceTest.java b/sdk/src/test/java/com/atlan/model/assets/PowerBIDatasourceTest.java index ce36f104c7..ae78969801 100644 --- a/sdk/src/test/java/com/atlan/model/assets/PowerBIDatasourceTest.java +++ b/sdk/src/test/java/com/atlan/model/assets/PowerBIDatasourceTest.java @@ -435,6 +435,8 @@ public class PowerBIDatasourceTest { .connectionDetail("key2", "value2") .dataset(PowerBIDataset.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) .dataset(PowerBIDataset.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) + .powerBIDataflow(PowerBIDataflow.refByGuid("705d96f4-bdb6-4792-8dfe-8dc4ca3d2c23")) + .powerBIDataflow(PowerBIDataflow.refByQualifiedName("default/snowflake/1234567890/test/qualifiedName")) .build(); private static final int hash = full.hashCode();