io.polyapi.plugin.model.specification.function.AuthFunctionSpecification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polyapi-maven-plugin Show documentation
Show all versions of polyapi-maven-plugin Show documentation
Maven plugin to run handle Poly API functions.
package io.polyapi.plugin.model.specification.function;
import io.polyapi.plugin.model.visitor.PolySpecificationVisitor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AuthFunctionSpecification extends FunctionSpecification {
private String subResource;
public boolean isAudienceRequired() {
return getFunction().getArguments().stream().anyMatch(argument -> argument.getName().equals("audience"));
}
@Override
public void accept(PolySpecificationVisitor visitor) {
visitor.visit(this);
}
@Override
protected String getSpecificationSubtype() {
return "auth";
}
}