aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/AssertionEntity.java
blob: 8b76186f66c5aa1913227477be2d58aa65d05a53 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright Vespa.ai. 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.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author olaa
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class AssertionEntity {

    private final String role;
    private final String resource;
    private final String action;
    private final Long id;
    private final String effect;


    public AssertionEntity(String role, String resource, String action, String effect) {
        this(role, resource, action, null, effect);
    }

    public AssertionEntity(@JsonProperty("role") String role,
                           @JsonProperty("resource") String resource,
                           @JsonProperty("action") String action,
                           @JsonProperty("id") Long id,
                           @JsonProperty("effect") String effect) {
        this.role = role;
        this.resource = resource;
        this.action = action;
        this.id = id;
        this.effect = effect;
    }

    public String getRole() {
        return role;
    }

    public String getResource() {
        return resource;
    }

    public String getAction() {
        return action;
    }

    public String getEffect() {
        return effect;
    }

    @JsonIgnore
    public long getId() {
        return id;
    }
}