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

org.kohsuke.github.GraphQLExternalIdentity Maven / Gradle / Ivy

package org.kohsuke.github;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Represents the result of a GraphQL externalIdentity.
 *
 * @author Hiroyuki Wada
 */
public class GraphQLExternalIdentity extends GraphQLNode {

    @JsonProperty("guid")
    public String guid;

    @JsonProperty("organizationInvitation")
    public GraphQLOrganizationInvitation organizationInvitation;

    @JsonProperty("samlIdentity")
    public GraphQLExternalIdentitySamlAttributes samlIdentity;

    @JsonProperty("scimIdentity")
    public GraphQLExternalIdentityScimAttributes scimIdentity;

    @JsonProperty("user")
    public GraphQLUser user;

    @JsonIgnore
    public boolean isPending() {
        return organizationInvitation != null && user == null;
    }

    @JsonIgnore
    public boolean isCompleted() {
        return user != null && user.organization != null;
    }

    @JsonIgnore
    public boolean isDropped() {
        return user != null && user.organization == null;
    }

    @JsonIgnore
    public String getStatus() {
        if (isPending()) {
            return "pending";
        }
        if (isCompleted()) {
            return "active";
        }
        return "dropped";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy