/*
 * Copyright 2015-2016 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.hod.client.api.authentication.tokeninformation;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.hp.autonomy.hod.client.api.userstore.user.Account;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.UUID;

/**
 * Information about the user component of an authentication token.
 */
@Data
public class UserInformation implements Serializable {
    private static final long serialVersionUID = -2610523494602694306L;

    /**
     * @return The UUID of the user
     */
    private final UUID uuid;

    /**
     * @return Information about the mechanism used to authenticate the user
     */
    private final AuthenticationInformation authentication;

    /**
     * @return Groups directly associated with the user
     */
    private final List<String> directGroups;

    /**
     * @return Groups either directly or transitively associated with the user
     */
    private final List<String> groups;

    /**
     * @return Accounts associated with the user
     */
    private final List<Account> accounts;

    public UserInformation(
        @JsonProperty("uuid") final UUID uuid,
        @JsonProperty("auth") final AuthenticationInformation authentication,
        @JsonProperty("direct_groups") final List<String> directGroups,
        @JsonProperty("groups") final List<String> groups,
        @JsonProperty("accounts") final List<Account> accounts
    ) {
        this.uuid = uuid;
        this.authentication = authentication;
        this.directGroups = directGroups;
        this.groups = groups;
        this.accounts = accounts;
    }
}

@@ -918,261 +918,8 @@
 n;%0A%0A
-    /**%0A     * @return Groups directly associated with the user%0A     */%0A    private final List%3CString%3E directGroups;%0A%0A    /**%0A     * @return Groups either directly or transitively associated with the user%0A     */%0A    private final List%3CString%3E groups;%0A%0A
     
@@ -1179,139 +1179,8 @@
 on,%0A
-        @JsonProperty(%22direct_groups%22) final List%3CString%3E directGroups,%0A        @JsonProperty(%22groups%22) final List%3CString%3E groups,%0A
     
@@ -1322,80 +1322,8 @@
 on;%0A
-        this.directGroups = directGroups;%0A        this.groups = groups;%0A
     

Fix user information parsing that had a different response format than expected - for now remove group info