APIRequest.java

  1. package org.heigit.ors.api.requests.common;

  2. import com.fasterxml.jackson.annotation.JsonIgnore;
  3. import com.fasterxml.jackson.annotation.JsonProperty;
  4. import io.swagger.v3.oas.annotations.media.Schema;
  5. import org.heigit.ors.api.APIEnums;

  6. public class APIRequest {
  7.     public static final String PARAM_ID = "id";
  8.     public static final String PARAM_PROFILE = "profile";

  9.     @Schema(name = PARAM_ID, description = "Arbitrary identification string of the request reflected in the meta information.",
  10.             example = "my_request")
  11.     @JsonProperty(PARAM_ID)
  12.     protected String id;
  13.     @JsonIgnore
  14.     private boolean hasId = false;

  15.     @Schema(name = PARAM_PROFILE, hidden = true)
  16.     protected APIEnums.Profile profile;

  17.     public boolean hasId() {
  18.         return hasId;
  19.     }

  20.     public String getId() {
  21.         return id;
  22.     }

  23.     public void setId(String id) {
  24.         this.id = id;
  25.         this.hasId = true;
  26.     }

  27.     public APIEnums.Profile getProfile() {
  28.         return profile;
  29.     }

  30.     public void setProfile(APIEnums.Profile profile) {
  31.         this.profile = profile;
  32.     }

  33. }