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

com.files.models.Status Maven / Gradle / Ivy

Go to download

The Files.com Java client library provides convenient access to the Files.com API from JVM based applications.

There is a newer version: 1.4.123
Show newest version
package com.files.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.files.FilesClient;
import com.files.FilesConfig;
import com.files.net.HttpMethods.RequestMethods;
import com.files.util.ModelUtils;
import com.files.util.FilesInputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;

public class Status {
  private HashMap options;
  private ObjectMapper objectMapper = JsonMapper
    .builder()
    .disable(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)
    .build();

  public Status() {
    this(null, null);
  }

  public Status(HashMap parameters) {
    this(parameters, null);
  }

  public Status(HashMap parameters, HashMap options) {
    this.options = options;
    try{
      ObjectReader objectReader = objectMapper.readerForUpdating(this);
      objectReader.readValue(objectMapper.writeValueAsString(parameters));
    } catch (JsonProcessingException e){
      // TODO: error generation on constructor
    }
  }

  /**
  * Status HTTP code
  */
  @Getter
  @JsonProperty("code")
  public Long code;

  /**
  * Error message
  */
  @Getter
  @JsonProperty("message")
  public String message;

  /**
  * Status message
  */
  @Getter
  @JsonProperty("status")
  public String status;

  /**
  * Additional data
  */
  @Getter
  @JsonProperty("data")
  public Auto data;

  /**
  * A list of api errors
  */
  @Getter
  @JsonProperty("errors")
  public Object[] errors;

  /**
  * Required Clickwrap id
  */
  @Getter
  @JsonProperty("clickwrap_id")
  public Long clickwrapId;

  /**
  * Required Clickwrap body
  */
  @Getter
  @JsonProperty("clickwrap_body")
  public String clickwrapBody;



}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy