All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.openfga.client.model.AuthorizationModel Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package io.quarkiverse.openfga.client.model;

import java.util.List;
import java.util.Objects;

import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkiverse.openfga.client.model.utils.Preconditions;

public final class AuthorizationModel {
    private final String id;
    private final String schemaVersion;
    private final List typeDefinitions;

    public AuthorizationModel(String id, @JsonProperty("schema_version") String schemaVersion,
            @JsonProperty("type_definitions") List typeDefinitions) {
        this.id = Preconditions.parameterNonNull(id, "id");
        this.schemaVersion = Preconditions.parameterNonNull(schemaVersion, "schemaVersion");
        this.typeDefinitions = Preconditions.parameterNonNull(typeDefinitions, "typeDefinitions");
    }

    public String getId() {
        return id;
    }

    @JsonProperty("schema_version")
    public String getSchemaVersion() {
        return schemaVersion;
    }

    @JsonProperty("type_definitions")
    public List getTypeDefinitions() {
        return typeDefinitions;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (obj == this)
            return true;
        if (obj == null || obj.getClass() != this.getClass())
            return false;
        var that = (AuthorizationModel) obj;
        return Objects.equals(this.id, that.id) &&
                Objects.equals(this.typeDefinitions, that.typeDefinitions);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, typeDefinitions);
    }

    @Override
    public String toString() {
        return "AuthorizationModel[" +
                "id=" + id + ", " +
                "typeDefinitions=" + typeDefinitions + ']';
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy