001package org.apache.archiva.redback.rest.api.model.v2;
002/*
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019
020import io.swagger.v3.oas.annotations.media.Schema;
021
022import javax.xml.bind.annotation.XmlRootElement;
023import java.io.Serializable;
024
025/**
026 * Data provided to the REST service for updating the password of the current logged in user
027 *
028 * @author Martin Stockhammer <martin_s@apache.org>
029 * @since 3.0
030 */
031@XmlRootElement( name = "passwordChange" )
032@Schema(name="PasswordChange", description = "Data for password change")
033public class PasswordChange implements Serializable
034{
035    private static final long serialVersionUID = -1173796138433747226L;
036    String currentPassword;
037    String userId;
038    String newPassword;
039    String newPasswordConfirmation;
040
041    @Schema(name="current_password", description = "The current password of the logged in user, or a initial registration key")
042    public String getCurrentPassword( )
043    {
044        return currentPassword;
045    }
046
047    public void setCurrentPassword( String currentPassword )
048    {
049        this.currentPassword = currentPassword;
050    }
051
052
053    @Schema(name="user_id", description = "The User Id for the user to change the password. Must match the current logged in user.")
054    public String getUserId( )
055    {
056        return userId;
057    }
058
059    public void setUserId( String userId )
060    {
061        this.userId = userId;
062    }
063
064    @Schema(name="new_password", description = "The new password to set")
065    public String getNewPassword( )
066    {
067        return newPassword;
068    }
069
070    public void setNewPassword( String newPassword )
071    {
072        this.newPassword = newPassword;
073    }
074
075    @Schema(name="new_password_confirmation", description = "The new password to set as confirmation that it is typed correctly")
076    public String getNewPasswordConfirmation( )
077    {
078        return newPasswordConfirmation;
079    }
080
081    public void setNewPasswordConfirmation( String newPasswordConfirmation )
082    {
083        this.newPasswordConfirmation = newPasswordConfirmation;
084    }
085}