io.lakefs.clients.api.model.ImportLocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
lakeFS OpenAPI Java client legacy SDK
/*
* lakeFS API
* lakeFS HTTP API
*
* The version of the OpenAPI document: 1.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 io.lakefs.clients.api.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* ImportLocation
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class ImportLocation {
/**
* Path type, can either be 'common_prefix' or 'object'
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
COMMON_PREFIX("common_prefix"),
OBJECT("object");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
public static final String SERIALIZED_NAME_PATH = "path";
@SerializedName(SERIALIZED_NAME_PATH)
private String path;
public static final String SERIALIZED_NAME_DESTINATION = "destination";
@SerializedName(SERIALIZED_NAME_DESTINATION)
private String destination;
public ImportLocation type(TypeEnum type) {
this.type = type;
return this;
}
/**
* Path type, can either be 'common_prefix' or 'object'
* @return type
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Path type, can either be 'common_prefix' or 'object'")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public ImportLocation path(String path) {
this.path = path;
return this;
}
/**
* A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type.
* @return path
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "s3://my-bucket/production/collections/", required = true, value = "A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type.")
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public ImportLocation destination(String destination) {
this.destination = destination;
return this;
}
/**
* Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch.
* @return destination
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "collections/", required = true, value = "Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch. ")
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ImportLocation importLocation = (ImportLocation) o;
return Objects.equals(this.type, importLocation.type) &&
Objects.equals(this.path, importLocation.path) &&
Objects.equals(this.destination, importLocation.destination);
}
@Override
public int hashCode() {
return Objects.hash(type, path, destination);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ImportLocation {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" path: ").append(toIndentedString(path)).append("\n");
sb.append(" destination: ").append(toIndentedString(destination)).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 ");
}
}