com.dominodatalab.api.model.DominoQuotaApiQuotaDto Maven / Gradle / Ivy
/*
* Domino Data Lab API v4
* This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key.
*
* The version of the OpenAPI document: 4.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.dominodatalab.api.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.dominodatalab.api.model.DominoQuotaApiQuotaActionMetadata;
import com.dominodatalab.api.model.DominoQuotaApiQuotaType;
import com.dominodatalab.api.model.DominoQuotaApiTargetMetadata;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* DominoQuotaApiQuotaDto
*/
@JsonPropertyOrder({
DominoQuotaApiQuotaDto.JSON_PROPERTY_ID,
DominoQuotaApiQuotaDto.JSON_PROPERTY_LIMIT,
DominoQuotaApiQuotaDto.JSON_PROPERTY_TARGET_ID,
DominoQuotaApiQuotaDto.JSON_PROPERTY_QUOTA_TYPE,
DominoQuotaApiQuotaDto.JSON_PROPERTY_ACTION_METADATA,
DominoQuotaApiQuotaDto.JSON_PROPERTY_TARGET_METADATA
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoQuotaApiQuotaDto {
public static final String JSON_PROPERTY_ID = "id";
private String id;
public static final String JSON_PROPERTY_LIMIT = "limit";
private Long limit;
public static final String JSON_PROPERTY_TARGET_ID = "targetId";
private String targetId;
public static final String JSON_PROPERTY_QUOTA_TYPE = "quotaType";
private DominoQuotaApiQuotaType quotaType;
public static final String JSON_PROPERTY_ACTION_METADATA = "actionMetadata";
private Map actionMetadata = new HashMap<>();
public static final String JSON_PROPERTY_TARGET_METADATA = "targetMetadata";
private Map targetMetadata = new HashMap<>();
public DominoQuotaApiQuotaDto() {
}
public DominoQuotaApiQuotaDto id(String id) {
this.id = id;
return this;
}
/**
* quota Id
* @return id
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setId(String id) {
this.id = id;
}
public DominoQuotaApiQuotaDto limit(Long limit) {
this.limit = limit;
return this;
}
/**
* quota limit
* @return limit
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_LIMIT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getLimit() {
return limit;
}
@JsonProperty(JSON_PROPERTY_LIMIT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setLimit(Long limit) {
this.limit = limit;
}
public DominoQuotaApiQuotaDto targetId(String targetId) {
this.targetId = targetId;
return this;
}
/**
* Id of user for quota
* @return targetId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TARGET_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getTargetId() {
return targetId;
}
@JsonProperty(JSON_PROPERTY_TARGET_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public DominoQuotaApiQuotaDto quotaType(DominoQuotaApiQuotaType quotaType) {
this.quotaType = quotaType;
return this;
}
/**
* Get quotaType
* @return quotaType
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_QUOTA_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public DominoQuotaApiQuotaType getQuotaType() {
return quotaType;
}
@JsonProperty(JSON_PROPERTY_QUOTA_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setQuotaType(DominoQuotaApiQuotaType quotaType) {
this.quotaType = quotaType;
}
public DominoQuotaApiQuotaDto actionMetadata(Map actionMetadata) {
this.actionMetadata = actionMetadata;
return this;
}
public DominoQuotaApiQuotaDto putActionMetadataItem(String key, DominoQuotaApiQuotaActionMetadata actionMetadataItem) {
if (this.actionMetadata == null) {
this.actionMetadata = new HashMap<>();
}
this.actionMetadata.put(key, actionMetadataItem);
return this;
}
/**
* Get actionMetadata
* @return actionMetadata
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ACTION_METADATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map getActionMetadata() {
return actionMetadata;
}
@JsonProperty(JSON_PROPERTY_ACTION_METADATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setActionMetadata(Map actionMetadata) {
this.actionMetadata = actionMetadata;
}
public DominoQuotaApiQuotaDto targetMetadata(Map targetMetadata) {
this.targetMetadata = targetMetadata;
return this;
}
public DominoQuotaApiQuotaDto putTargetMetadataItem(String key, DominoQuotaApiTargetMetadata targetMetadataItem) {
if (this.targetMetadata == null) {
this.targetMetadata = new HashMap<>();
}
this.targetMetadata.put(key, targetMetadataItem);
return this;
}
/**
* Get targetMetadata
* @return targetMetadata
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TARGET_METADATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map getTargetMetadata() {
return targetMetadata;
}
@JsonProperty(JSON_PROPERTY_TARGET_METADATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTargetMetadata(Map targetMetadata) {
this.targetMetadata = targetMetadata;
}
/**
* Return true if this domino.quota.api.QuotaDto object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DominoQuotaApiQuotaDto dominoQuotaApiQuotaDto = (DominoQuotaApiQuotaDto) o;
return Objects.equals(this.id, dominoQuotaApiQuotaDto.id) &&
Objects.equals(this.limit, dominoQuotaApiQuotaDto.limit) &&
Objects.equals(this.targetId, dominoQuotaApiQuotaDto.targetId) &&
Objects.equals(this.quotaType, dominoQuotaApiQuotaDto.quotaType) &&
Objects.equals(this.actionMetadata, dominoQuotaApiQuotaDto.actionMetadata) &&
Objects.equals(this.targetMetadata, dominoQuotaApiQuotaDto.targetMetadata);
}
@Override
public int hashCode() {
return Objects.hash(id, limit, targetId, quotaType, actionMetadata, targetMetadata);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DominoQuotaApiQuotaDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" targetId: ").append(toIndentedString(targetId)).append("\n");
sb.append(" quotaType: ").append(toIndentedString(quotaType)).append("\n");
sb.append(" actionMetadata: ").append(toIndentedString(actionMetadata)).append("\n");
sb.append(" targetMetadata: ").append(toIndentedString(targetMetadata)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `id` to the URL query string
if (getId() != null) {
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `limit` to the URL query string
if (getLimit() != null) {
joiner.add(String.format("%slimit%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLimit()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `targetId` to the URL query string
if (getTargetId() != null) {
joiner.add(String.format("%stargetId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTargetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `quotaType` to the URL query string
if (getQuotaType() != null) {
joiner.add(String.format("%squotaType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuotaType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `actionMetadata` to the URL query string
if (getActionMetadata() != null) {
for (String _key : getActionMetadata().keySet()) {
if (getActionMetadata().get(_key) != null) {
joiner.add(getActionMetadata().get(_key).toUrlQueryString(String.format("%sactionMetadata%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
}
}
}
// add `targetMetadata` to the URL query string
if (getTargetMetadata() != null) {
for (String _key : getTargetMetadata().keySet()) {
if (getTargetMetadata().get(_key) != null) {
joiner.add(getTargetMetadata().get(_key).toUrlQueryString(String.format("%stargetMetadata%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
}
}
}
return joiner.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy