package com.friday.tooldriver.dto.uipath.response;

import com.alibaba.fastjson.annotation.JSONField;
import com.friday.operation.api.tooldriver.dto.rpa.RobotDto;
import com.friday.tooldriver.dto.uipath.request.UserRequestDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserResponseDto extends UserRequestDto {
    @JSONField(name="IsActive")
    private boolean active;
    @JSONField(name="CreationTime")
    private String creationTime;
    @JSONField(name="LoginProviders")
    private List<String> loginProviders;
    @JSONField(name="TenantId")
    private Integer  tenantId;
    @JSONField(name="Type")
    private String type;
    @JSONField(name="ProvisionType")
    private String provisionType;
    @JSONField(name="Key")
    private String key;

    public RobotExtInfoDto transferToExtRobotDto(){
        RobotExtInfoDto robot = new RobotExtInfoDto();
        robot.setName(this.getUserName());
        robot.setKey(String.valueOf(this.getId()));
        return robot;
    }
}
