aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/TenancyRequestEntity.java
blob: 913f1011595bae1a119bb55f073b08100b57f711 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.client.zms.bindings;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yahoo.vespa.athenz.api.AthenzDomain;
import com.yahoo.vespa.athenz.api.AthenzIdentity;
import com.yahoo.vespa.athenz.api.AthenzService;

import java.util.List;

/**
 * @author bjorncs
 */
public class TenancyRequestEntity {

    @JsonProperty("domain")
    private final String tenantDomain;

    @JsonProperty("service")
    private final String providerService;

    @JsonProperty("resourceGroups")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private final List<String> resourceGroups;

    public TenancyRequestEntity(AthenzDomain tenantDomain, AthenzIdentity providerService, List<String> resourceGroups) {
        this.tenantDomain = tenantDomain.getName();
        this.providerService = providerService.getFullName();
        this.resourceGroups = resourceGroups;
    }
}