All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.larksuite.oapi.core.model.OapiResponse Maven / Gradle / Ivy

Go to download

Larksuite open platform facilitates the integration of enterprise applications and larksuite, making collaboration and management more efficient

There is a newer version: 1.0.18-rc8
Show newest version
package com.larksuite.oapi.core.model;

import com.larksuite.oapi.core.Constants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class OapiResponse {

    public static final String RESPONSE_FORMAT = "{\"codemsg\":\"%s\"}";
    public static final String CHALLENGE_RESPONSE_FORMAT = "{\"challenge\":\"%s\"}";

    private int statusCode;
    private String contentType;
    private Map> headers = new HashMap<>();
    private String body;

    public OapiResponse() {
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
        List ct = new ArrayList<>();
        ct.add(contentType);
        this.headers.put(Constants.CONTENT_TYPE, ct);
    }

    public Map> getHeaders() {
        return headers;
    }

    public void setHeaders(Map> headers) {
        this.headers = headers;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy