aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'controller-api/src/main/java/com')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/BillingReference.java6
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java12
2 files changed, 16 insertions, 2 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/BillingReference.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/BillingReference.java
new file mode 100644
index 00000000000..a1afdc511bd
--- /dev/null
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/BillingReference.java
@@ -0,0 +1,6 @@
+package com.yahoo.vespa.hosted.controller.tenant;
+
+import java.time.Instant;
+
+public record BillingReference(String reference, Instant updated) {
+}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
index 2275f3a9bf8..4d7aee7b604 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
@@ -27,11 +27,14 @@ public class CloudTenant extends Tenant {
private final List<TenantSecretStore> tenantSecretStores;
private final ArchiveAccess archiveAccess;
private final Optional<Instant> invalidateUserSessionsBefore;
+ private final Optional<BillingReference> billingReference;
/** Public for the serialization layer — do not use! */
public CloudTenant(TenantName name, Instant createdAt, LastLoginInfo lastLoginInfo, Optional<SimplePrincipal> creator,
BiMap<PublicKey, SimplePrincipal> developerKeys, TenantInfo info,
- List<TenantSecretStore> tenantSecretStores, ArchiveAccess archiveAccess, Optional<Instant> invalidateUserSessionsBefore, Instant tenantRoleLastMaintained) {
+ List<TenantSecretStore> tenantSecretStores, ArchiveAccess archiveAccess,
+ Optional<Instant> invalidateUserSessionsBefore, Instant tenantRoleLastMaintained,
+ Optional<BillingReference> billingReference) {
super(name, createdAt, lastLoginInfo, Optional.empty(), tenantRoleLastMaintained);
this.creator = creator;
this.developerKeys = developerKeys;
@@ -39,6 +42,7 @@ public class CloudTenant extends Tenant {
this.tenantSecretStores = tenantSecretStores;
this.archiveAccess = Objects.requireNonNull(archiveAccess);
this.invalidateUserSessionsBefore = invalidateUserSessionsBefore;
+ this.billingReference = Objects.requireNonNull(billingReference);
}
/** Creates a tenant with the given name, provided it passes validation. */
@@ -47,7 +51,7 @@ public class CloudTenant extends Tenant {
createdAt,
LastLoginInfo.EMPTY,
Optional.ofNullable(creator).map(SimplePrincipal::of),
- ImmutableBiMap.of(), TenantInfo.empty(), List.of(), new ArchiveAccess(), Optional.empty(), Instant.EPOCH);
+ ImmutableBiMap.of(), TenantInfo.empty(), List.of(), new ArchiveAccess(), Optional.empty(), Instant.EPOCH, Optional.empty());
}
/** The user that created the tenant */
@@ -83,6 +87,10 @@ public class CloudTenant extends Tenant {
return invalidateUserSessionsBefore;
}
+ public Optional<BillingReference> billingReference() {
+ return billingReference;
+ }
+
@Override
public Type type() {
return Type.cloud;