package com.atlassian.stash.internal.rest.user.json;

import com.atlassian.bitbucket.rest.user.ExampleDetailedUser;
import com.atlassian.bitbucket.validation.annotation.RequiredString;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize
public class AdminPasswordUpdate extends PasswordUpdate {
    @JsonProperty
    private final String name;

    // for Jackson
    protected AdminPasswordUpdate() {
        this(null, null, null);
    }

    public AdminPasswordUpdate(String name, String password, String passwordConfirm) {
        super(password, passwordConfirm);
        this.name = name;
    }

    @RequiredString(size = 255)
    public String getName() {
        return name;
    }

    public static final AdminPasswordUpdate EXAMPLE = new AdminPasswordUpdate(
            ExampleDetailedUser.EXAMPLE.getName(), "secret", "secret");
}
