Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package core.backend.aws.dynamodb.repository;

import core.tapir.DeployKey;
import core.tapir.DeployKeyScope;
import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey;

import core.backend.aws.dynamodb.converter.ArtifactVersionsConverter;
Expand Down Expand Up @@ -109,6 +110,27 @@ public class TableSchemas {
.getter(DeployKey::getId)
.setter(DeployKey::setId)
.tags(primaryPartitionKey()))
.addAttribute(String.class, a -> a.name("resourceType")
.getter(DeployKey::getResourceType)
.setter(DeployKey::setResourceType))
.addAttribute(String.class, a -> a.name("scope")
.getter(k -> k.getScope() != null ? k.getScope().name() : null)
.setter((k, v) -> k.setScope(v != null ? DeployKeyScope.valueOf(v) : null)))
.addAttribute(String.class, a -> a.name("source")
.getter(DeployKey::getSource)
.setter(DeployKey::setSource))
.addAttribute(String.class, a -> a.name("namespace")
.getter(DeployKey::getNamespace)
.setter(DeployKey::setNamespace))
.addAttribute(String.class, a -> a.name("provider")
.getter(DeployKey::getProvider)
.setter(DeployKey::setProvider))
.addAttribute(String.class, a -> a.name("name")
.getter(DeployKey::getName)
.setter(DeployKey::setName))
.addAttribute(String.class, a -> a.name("type")
.getter(DeployKey::getType)
.setter(DeployKey::setType))
.addAttribute(String.class, a -> a.name("key")
.getter(DeployKey::getKey)
.setter(DeployKey::setKey))
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/core/tapir/DeployKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,58 @@ public DeployKeyScope getScope() {
return scope;
}

public void setScope(DeployKeyScope scope) {
this.scope = scope;
}

public String getResourceType() {
return resourceType;
}

public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}

public String getSource() {
return source;
}

public void setSource(String source) {
this.source = source;
}

public String getNamespace() {
return namespace;
}

public void setNamespace(String namespace) {
this.namespace = namespace;
}

public String getProvider() {
return provider;
}

public void setProvider(String provider) {
this.provider = provider;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public boolean ValidForModule(Module module) {
if (!Objects.equals(this.resourceType, "module")) {
return false;
Expand Down