package com.parse;

import com.parse.http.ParseHttpRequest;
import com.parse.http.ParseHttpResponse;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
import p137.C2742;

/* JADX INFO: loaded from: classes.dex */
public class ParseRESTUserCommand extends ParseRESTCommand {
    public boolean isRevocableSessionEnabled;
    public int statusCode;

    public ParseRESTUserCommand(String str, ParseHttpRequest.Method method, Map<String, ?> map, String str2) {
        super(str, method, map, str2);
        this.isRevocableSessionEnabled = false;
    }

    public ParseRESTUserCommand(String str, ParseHttpRequest.Method method, Map<String, ?> map, String str2, boolean z) {
        super(str, method, map, str2);
        this.isRevocableSessionEnabled = z;
    }

    public ParseRESTUserCommand(String str, ParseHttpRequest.Method method, JSONObject jSONObject, String str2, boolean z) {
        super(str, method, jSONObject, str2);
        this.isRevocableSessionEnabled = z;
    }

    public static ParseRESTUserCommand logInUserCommand(String str, String str2, boolean z) {
        HashMap map = new HashMap();
        map.put("username", str);
        map.put("password", str2);
        return new ParseRESTUserCommand("login", ParseHttpRequest.Method.GET, map, (String) null, z);
    }

    public static ParseRESTUserCommand resetPasswordResetCommand(String str) {
        HashMap map = new HashMap();
        map.put("email", str);
        return new ParseRESTUserCommand("requestPasswordReset", ParseHttpRequest.Method.POST, map, null);
    }

    @Override // com.parse.ParseRESTCommand
    public void addAdditionalHeaders(ParseHttpRequest.Builder builder) {
        super.addAdditionalHeaders(builder);
        if (this.isRevocableSessionEnabled) {
            builder.headers.put("X-Parse-Revocable-Session", "1");
        }
    }

    @Override // com.parse.ParseRESTCommand, com.parse.ParseRequest
    public C2742<JSONObject> onResponseAsync(ParseHttpResponse parseHttpResponse, ProgressCallback progressCallback) {
        this.statusCode = parseHttpResponse.statusCode;
        return super.onResponseAsync(parseHttpResponse, progressCallback);
    }
}
