com.memority.citadel.shared.api.im.AuthMethodChange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of citadel-api Show documentation
Show all versions of citadel-api Show documentation
This artifact provides the API classes that are necessary to implement general configuration Rules on the Memority IM platform.
/*
* Copyright (c) 2016-2023 Memority. All Rights Reserved.
*
* This file is part of Memority Citadel API , a Memority project.
*
* This file is released under the Memority Public Artifacts End-User License Agreement,
* see
* Unauthorized copying of this file, via any medium is strictly prohibited.
*/
package com.memority.citadel.shared.api.im;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static com.memority.citadel.shared.api.im.AuthMethodChange.Operation.*;
@Data
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "method")
@JsonSubTypes({
@JsonSubTypes.Type(name = "INWEBO", value = InWeboAuthMethodChange.class)
// TODO finish password related handling
})
public abstract class AuthMethodChange {
protected AuthMethodChange.Method method;
protected AuthMethodChange.Operation operation;
public enum Method {
INWEBO(CREATE_USER, DELETE_USER, ADD_DEVICE, DELETE_DEVICE),
PASSWORD(CREATE_USER, DELETE_USER)
;
private final List operations;
Method(AuthMethodChange.Operation... operations) {
this.operations = Arrays.asList(operations);
}
public List getOperations() {
return Collections.unmodifiableList(this.operations);
}
}
public enum Operation {
CREATE_USER,
DELETE_USER,
ADD_DEVICE,
DELETE_DEVICE
}
}