Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXD-347 : Support for Anaplan typedefs #1177

Merged
merged 6 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

613 changes: 613 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanApp.java

Large diffs are not rendered by default.

706 changes: 706 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanDimension.java

Large diffs are not rendered by default.

719 changes: 719 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanLineItem.java

Large diffs are not rendered by default.

694 changes: 694 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanList.java

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanModel.java

Large diffs are not rendered by default.

695 changes: 695 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanModule.java

Large diffs are not rendered by default.

680 changes: 680 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanPage.java

Large diffs are not rendered by default.

719 changes: 719 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanView.java

Large diffs are not rendered by default.

624 changes: 624 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/AnaplanWorkspace.java

Large diffs are not rendered by default.

636 changes: 636 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplan.java

Large diffs are not rendered by default.

618 changes: 618 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanApp.java

Large diffs are not rendered by default.

642 changes: 642 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanDimension.java

Large diffs are not rendered by default.

637 changes: 637 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanLineItem.java

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanList.java

Large diffs are not rendered by default.

642 changes: 642 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanModel.java

Large diffs are not rendered by default.

630 changes: 630 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanModule.java

Large diffs are not rendered by default.

643 changes: 643 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanPage.java

Large diffs are not rendered by default.

636 changes: 636 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanView.java

Large diffs are not rendered by default.

633 changes: 633 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/IAnaplanWorkspace.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public enum AtlanConnectorType implements AtlanEnum {
AWS_ECS("aws-ecs", AtlanConnectionCategory.ELT),
AWS_LAMBDA("aws-lambda", AtlanConnectionCategory.ELT),
AWS_SAGEMAKER("aws-sagemaker", AtlanConnectionCategory.ELT),
ANAPLAN("anaplan", AtlanConnectionCategory.BI),
;

@JsonValue
Expand Down
47 changes: 47 additions & 0 deletions sdk/src/main/resources/templates/AnaplanApp.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<#macro all>
/**
* Builds the minimal object necessary to create an Anaplan app.
*
* @param name of the Anaplan app
* @param connectionQualifiedName unique name of the connection through which the app is accessible
* @return the minimal object necessary to create the Anaplan app, as a builder
*/
public static AnaplanApp.AnaplanAppBuilder<?, ?> creator(String name, String connectionQualifiedName) {
return AnaplanApp._internal()
.guid("-" + ThreadLocalRandom.current().nextLong(0, Long.MAX_VALUE - 1))
.qualifiedName(connectionQualifiedName + "/" + name)
.name(name)
.connectionQualifiedName(connectionQualifiedName)
.connectorType(AtlanConnectorType.ANAPLAN);
}

/**
* Builds the minimal object necessary to update a AnaplanApp.
*
* @param qualifiedName of the AnaplanApp
* @param name of the AnaplanApp
* @return the minimal request necessary to update the AnaplanApp, as a builder
*/
public static AnaplanAppBuilder<?, ?> updater(String qualifiedName, String name) {
return AnaplanApp._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 AnaplanApp, from a potentially
* more-complete AnaplanApp object.
*
* @return the minimal object necessary to update the AnaplanApp, as a builder
* @throws InvalidRequestException if any of the minimal set of required properties for AnaplanApp are not found in the initial object
*/
@Override
public AnaplanAppBuilder<?, ?> trimToRequired() throws InvalidRequestException {
Map<String, String> map = new HashMap<>();
map.put("qualifiedName", this.getQualifiedName());
map.put("name", this.getName());
validateRequired(TYPE_NAME, map);
return updater(this.getQualifiedName(), this.getName());
}
</#macro>
118 changes: 118 additions & 0 deletions sdk/src/main/resources/templates/AnaplanDimension.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<#macro all>
/**
* Builds the minimal object necessary to create a Anaplan dimension.
*
* @param name of the dimension
* @param model in which the dimension should be created, which must have at least
* a qualifiedName
* @return the minimal request necessary to create the dimension, as a builder
* @throws InvalidRequestException if the model provided is without a qualifiedName
*/
public static AnaplanDimension.AnaplanDimensionBuilder<?, ?> creator(String name, AnaplanModel model)
throws InvalidRequestException {
Map<String, String> map = new HashMap<>();
map.put("modelQualifiedName", model.getQualifiedName());
map.put("modelName", model.getName());
map.put("connectionQualifiedName", model.getConnectionQualifiedName());
map.put("workspaceName", model.getAnaplanWorkspaceName());
map.put("workspaceQualifiedName", model.getAnaplanWorkspaceQualifiedName());
validateRelationship(AnaplanWorkspace.TYPE_NAME, map);
return creator(
name,
model.getConnectionQualifiedName(),
model.getName(),
model.getQualifiedName(),
model.getAnaplanWorkspaceName(),
model.getAnaplanWorkspaceQualifiedName())
.anaplanModel(model.trimToReference());
}

/**
* Builds the minimal object necessary to create a Anaplan dimension.
*
* @param name of the dimension
* @param modelQualifiedName unique name of the model in which this dimension exists
* @return the minimal request necessary to create the dimension, as a builder
*/
public static AnaplanDimension.AnaplanDimensionBuilder<?, ?> creator(String name, String modelQualifiedName) {
String workspaceQualifiedName = StringUtils.getParentQualifiedNameFromQualifiedName(modelQualifiedName);
String workspaceName = StringUtils.getNameFromQualifiedName(workspaceQualifiedName);
String connectionQualifiedName = StringUtils.getParentQualifiedNameFromQualifiedName(workspaceQualifiedName);
String modelName = StringUtils.getNameFromQualifiedName(modelQualifiedName);
return creator(
name, connectionQualifiedName, modelName, modelQualifiedName, workspaceName, workspaceQualifiedName);
}

/**
* Builds the minimal object necessary to create a Anaplan dimension.
*
* @param name of the dimension
* @param connectionQualifiedName unique name of the connection in which to create the dimension
* @param modelName name of the model in which to create the dimension
* @param modelQualifiedName unique name of the model in which to create the dimension
* @param workspaceName name of the workspace in which to create the dimension
* @param workspaceQualifiedName unique name of the workspace in which to create the dimension
* @return the minimal request necessary to create the dimension, as a builder
*/
public static AnaplanDimension.AnaplanDimensionBuilder<?, ?> creator(
String name,
String connectionQualifiedName,
String modelName,
String modelQualifiedName,
String workspaceName,
String workspaceQualifiedName) {
AtlanConnectorType connectorType = Connection.getConnectorTypeFromQualifiedName(connectionQualifiedName);
return AnaplanDimension._internal()
.guid("-" + ThreadLocalRandom.current().nextLong(0, Long.MAX_VALUE - 1))
.name(name)
.qualifiedName(generateQualifiedName(name, modelQualifiedName))
.connectionQualifiedName(connectionQualifiedName)
.connectorType(connectorType)
.anaplanWorkspaceName(workspaceName)
.anaplanWorkspaceQualifiedName(workspaceQualifiedName)
.anaplanModelName(modelName)
.anaplanModelQualifiedName(modelQualifiedName)
.anaplanModel(AnaplanModel.refByQualifiedName(modelQualifiedName));
}

/**
* Generate a unique dimension name.
*
* @param name of the dimension
* @param modelQualifiedName unique name of the model in which this dimension exists
* @return a unique name for the dimension
*/
public static String generateQualifiedName(String name, String modelQualifiedName) {
return modelQualifiedName + "/" + name;
}

/**
* Builds the minimal object necessary to update a AnaplanDimension.
*
* @param qualifiedName of the AnaplanDimension
* @param name of the AnaplanDimension
* @return the minimal request necessary to update the AnaplanDimension, as a builder
*/
public static AnaplanDimensionBuilder<?, ?> updater(String qualifiedName, String name) {
return AnaplanDimension._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 AnaplanDimension, from a potentially
* more-complete AnaplanDimension object.
*
* @return the minimal object necessary to update the AnaplanDimension, as a builder
* @throws InvalidRequestException if any of the minimal set of required properties for AnaplanDimension are not found in the initial object
*/
@Override
public AnaplanDimensionBuilder<?, ?> trimToRequired() throws InvalidRequestException {
Map<String, String> map = new HashMap<>();
map.put("qualifiedName", this.getQualifiedName());
map.put("name", this.getName());
validateRequired(TYPE_NAME, map);
return updater(this.getQualifiedName(), this.getName());
}
</#macro>
137 changes: 137 additions & 0 deletions sdk/src/main/resources/templates/AnaplanLineItem.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<#macro all>
/**
* Builds the minimal object necessary to create a Anaplan lineitem.
*
* @param name of the lineitem
* @param module in which the lineitem should be created, which must have at least
* a qualifiedName
* @return the minimal request necessary to create the lineitem, as a builder
* @throws InvalidRequestException if the module provided is without a qualifiedName
*/
public static AnaplanLineItem.AnaplanLineItemBuilder<?, ?> creator(String name, AnaplanModule module)
throws InvalidRequestException {
Map<String, String> map = new HashMap<>();
map.put("connectionQualifiedName", module.getConnectionQualifiedName());
map.put("workspaceQualifiedName", module.getAnaplanWorkspaceQualifiedName());
map.put("workspaceName", module.getAnaplanWorkspaceName());
map.put("modelQualifiedName", module.getAnaplanModelQualifiedName());
map.put("modelName", module.getAnaplanModelName());
map.put("moduleQualifiedName", module.getQualifiedName());
map.put("moduleName", module.getName());
validateRelationship(AnaplanWorkspace.TYPE_NAME, map);
return creator(
name,
module.getConnectionQualifiedName(),
module.getName(),
module.getQualifiedName(),
module.getAnaplanModelName(),
module.getAnaplanModelQualifiedName(),
module.getAnaplanWorkspaceName(),
module.getAnaplanWorkspaceQualifiedName())
.anaplanModule(module.trimToReference());
}

/**
* Builds the minimal object necessary to create a Anaplan lineitem.
*
* @param name of the lineitem
* @param moduleQualifiedName unique name of the module in which this lineitem exists
* @return the minimal request necessary to create the lineitem, as a builder
*/
public static AnaplanLineItem.AnaplanLineItemBuilder<?, ?> creator(String name, String moduleQualifiedName) {
String moduleName = StringUtils.getNameFromQualifiedName(moduleQualifiedName);
String modelQualifiedName = StringUtils.getParentQualifiedNameFromQualifiedName(moduleQualifiedName);
String modelName = StringUtils.getNameFromQualifiedName(modelQualifiedName);
String workspaceQualifiedName = StringUtils.getParentQualifiedNameFromQualifiedName(modelQualifiedName);
String workspaceName = StringUtils.getNameFromQualifiedName(workspaceQualifiedName);
String connectionQualifiedName = StringUtils.getParentQualifiedNameFromQualifiedName(workspaceQualifiedName);
return creator(
name,
connectionQualifiedName,
moduleName,
moduleQualifiedName,
modelName,
modelQualifiedName,
workspaceName,
workspaceQualifiedName);
}

/**
* Builds the minimal object necessary to create a Anaplan lineitem.
*
* @param name of the lineitem
* @param connectionQualifiedName unique name of the connection in which to create the lineitem
* @param moduleName name of the module in which to creat the lineitem
* @param moduleQualifiedName unique name of the module in which to create the lineitem
* @param modelName name of the model in which to create the lineitem
* @param modelQualifiedName unique name of the model in which to create the lineitem
* @param workspaceName name of the workspace in which to create the lineitem
* @param workspaceQualifiedName unique name of the workspace in which to create the lineitem
* @return the minimal request necessary to create the lineitem, as a builder
*/
public static AnaplanLineItem.AnaplanLineItemBuilder<?, ?> creator(
String name,
String connectionQualifiedName,
String moduleName,
String moduleQualifiedName,
String modelName,
String modelQualifiedName,
String workspaceName,
String workspaceQualifiedName) {
AtlanConnectorType connectorType = Connection.getConnectorTypeFromQualifiedName(connectionQualifiedName);
return AnaplanLineItem._internal()
.guid("-" + ThreadLocalRandom.current().nextLong(0, Long.MAX_VALUE - 1))
.name(name)
.qualifiedName(generateQualifiedName(name, moduleQualifiedName))
.connectionQualifiedName(connectionQualifiedName)
.connectorType(connectorType)
.anaplanWorkspaceName(workspaceName)
.anaplanWorkspaceQualifiedName(workspaceQualifiedName)
.anaplanModelName(modelName)
.anaplanModelQualifiedName(modelQualifiedName)
.anaplanModuleName(moduleName)
.anaplanModuleQualifiedName(moduleQualifiedName)
.anaplanModule(AnaplanModule.refByQualifiedName(moduleQualifiedName));
}

/**
* Generate a unique lineitem name.
*
* @param name of the lineitem
* @param moduleQualifiedName unique name of the module in which this lineitem exists
* @return a unique name for the lineitem
*/
public static String generateQualifiedName(String name, String moduleQualifiedName) {
return moduleQualifiedName + "/" + name;
}

/**
* Builds the minimal object necessary to update a AnaplanLineItem.
*
* @param qualifiedName of the AnaplanLineItem
* @param name of the AnaplanLineItem
* @return the minimal request necessary to update the AnaplanLineItem, as a builder
*/
public static AnaplanLineItemBuilder<?, ?> updater(String qualifiedName, String name) {
return AnaplanLineItem._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 AnaplanLineItem, from a potentially
* more-complete AnaplanLineItem object.
*
* @return the minimal object necessary to update the AnaplanLineItem, as a builder
* @throws InvalidRequestException if any of the minimal set of required properties for AnaplanLineItem are not found in the initial object
*/
@Override
public AnaplanLineItemBuilder<?, ?> trimToRequired() throws InvalidRequestException {
Map<String, String> map = new HashMap<>();
map.put("qualifiedName", this.getQualifiedName());
map.put("name", this.getName());
validateRequired(TYPE_NAME, map);
return updater(this.getQualifiedName(), this.getName());
}
</#macro>
Loading
Loading