diff --git a/.github/workflows/java-api-client.yaml b/.github/workflows/java-api-client.yaml index 126042400b1..cd406adba6b 100644 --- a/.github/workflows/java-api-client.yaml +++ b/.github/workflows/java-api-client.yaml @@ -9,6 +9,48 @@ on: description: Tag/version to publish jobs: + deploy-legacy: # TODO(1.0): Remove this job after releasing 1.0 + runs-on: ubuntu-20.04 + environment: Treeverse signing + steps: + - name: Checkout + uses: actions/checkout@v3 + + # Extract the version to 'version' based on workflow_dispatch or triggered tag in the published event + - name: Extract version + shell: bash + run: | + if [ "${{ github.event.inputs.tag }}" != "" ]; then + echo "tag=$(echo ${{ github.event.inputs.tag }} | sed s/^v//)" >> $GITHUB_OUTPUT + else + echo "tag=$(echo ${GITHUB_REF##*/} | sed s/^v//)" >> $GITHUB_OUTPUT + fi + id: version + + - name: Java generate package + run: make client-java-legacy PACKAGE_VERSION=${{ steps.version.outputs.tag }} + + - name: Install secret key for signing + run: | + cat <(echo -e '${{ secrets.OSSRH_GPG_SECRET_KEY }}') | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Set up Java and Maven Central Repository + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Build and publish package + working-directory: clients/java-legacy + run: mvn --batch-mode deploy -Dgpg.executable="${GITHUB_WORKSPACE}/scripts/gpg_loopback.sh" --activate-profiles sign-artifacts + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + deploy: runs-on: ubuntu-20.04 environment: Treeverse signing diff --git a/Makefile b/Makefile index 00ffcff748b..8d01f4ed3de 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,9 @@ PROTOC=$(DOCKER) run --rm -v $(shell pwd):/mnt $(PROTOC_IMAGE) CLIENT_JARS_BUCKET="s3://treeverse-clients-us-east/" # https://openapi-generator.tech -OPENAPI_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v5.3.0 +OPENAPI_LEGACY_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v5.3.0 +OPENAPI_LEGACY_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_LEGACY_GENERATOR_IMAGE) +OPENAPI_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v7.0.0 OPENAPI_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE) GOLANGCI_LINT_VERSION=v1.53.3 @@ -113,7 +115,7 @@ client-python: api/swagger.yml ## Generate SDK for Python client # remove the build folder as it also holds lakefs_client folder which keeps because we skip it during find rm -rf clients/python/build; cd clients/python && \ find . -depth -name lakefs_client -prune -o ! \( -name Gemfile -or -name Gemfile.lock -or -name _config.yml -or -name .openapi-generator-ignore -or -name templates -or -name setup.mustache -or -name client.mustache \) -delete - $(OPENAPI_GENERATOR) generate \ + $(OPENAPI_LEGACY_GENERATOR) generate \ -i /mnt/$< \ -g python \ -t /mnt/clients/python/templates \ @@ -124,18 +126,32 @@ client-python: api/swagger.yml ## Generate SDK for Python client -c /mnt/clients/python-codegen-config.yaml \ -o /mnt/clients/python -client-java: api/swagger.yml ## Generate SDK for Java (and Scala) client - rm -rf clients/java - $(OPENAPI_GENERATOR) generate \ +client-java-legacy: api/swagger.yml api/java-gen-ignore ## Generate legacy SDK for Java (and Scala) client + rm -rf clients/java-legacy + $(OPENAPI_LEGACY_GENERATOR) generate \ -i /mnt/$< \ + --ignore-file-override /mnt/api/java-gen-ignore \ -g java \ --invoker-package io.lakefs.clients.api \ - --http-user-agent "lakefs-java-sdk/$(PACKAGE_VERSION)" \ - --additional-properties=hideGenerationTimestamp=true,artifactVersion=$(PACKAGE_VERSION),parentArtifactId=lakefs-parent,parentGroupId=io.lakefs,parentVersion=0,groupId=io.lakefs,artifactId='api-client',artifactDescription='lakeFS OpenAPI Java client',artifactUrl=https://lakefs.io,apiPackage=io.lakefs.clients.api,modelPackage=io.lakefs.clients.api.model,mainPackage=io.lakefs.clients.api,developerEmail=services@treeverse.io,developerName='Treeverse lakeFS dev',developerOrganization='lakefs.io',developerOrganizationUrl='https://lakefs.io',licenseName=apache2,licenseUrl=http://www.apache.org/licenses/,scmConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmDeveloperConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmUrl=https://github.com/treeverse/lakeFS \ + --http-user-agent "lakefs-java-sdk/$(PACKAGE_VERSION)-legacy" \ + --additional-properties hideGenerationTimestamp=true,artifactVersion=$(PACKAGE_VERSION),parentArtifactId=lakefs-parent,parentGroupId=io.lakefs,parentVersion=0,groupId=io.lakefs,artifactId='api-client',artifactDescription='lakeFS OpenAPI Java client legacy SDK',artifactUrl=https://lakefs.io,apiPackage=io.lakefs.clients.api,modelPackage=io.lakefs.clients.api.model,mainPackage=io.lakefs.clients.api,developerEmail=services@treeverse.io,developerName='Treeverse lakeFS dev',developerOrganization='lakefs.io',developerOrganizationUrl='https://lakefs.io',licenseName=apache2,licenseUrl=http://www.apache.org/licenses/,scmConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmDeveloperConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmUrl=https://github.com/treeverse/lakeFS \ + -o /mnt/clients/java-legacy + +client-java: api/swagger.yml api/java-gen-ignore ## Generate SDK for Java (and Scala) client + rm -rf clients/java + mkdir -p clients/java + cp api/java-gen-ignore clients/java/.openapi-generator-ignore + $(OPENAPI_GENERATOR) generate \ + -i /mnt/api/swagger.yml \ + -g java \ + --invoker-package io.lakefs.clients.sdk \ + --http-user-agent "lakefs-java-sdk/$(PACKAGE_VERSION)-v1" \ + --additional-properties disallowAdditionalPropertiesIfNotPresent=false,useSingleRequestParameter=true,hideGenerationTimestamp=true,artifactVersion=$(PACKAGE_VERSION),parentArtifactId=lakefs-parent,parentGroupId=io.lakefs,parentVersion=0,groupId=io.lakefs,artifactId='sdk-client',artifactDescription='lakeFS OpenAPI Java client',artifactUrl=https://lakefs.io,apiPackage=io.lakefs.clients.sdk,modelPackage=io.lakefs.clients.sdk.model,mainPackage=io.lakefs.clients.sdk,developerEmail=services@treeverse.io,developerName='Treeverse lakeFS dev',developerOrganization='lakefs.io',developerOrganizationUrl='https://lakefs.io',licenseName=apache2,licenseUrl=http://www.apache.org/licenses/,scmConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmDeveloperConnection=scm:git:git@github.com:treeverse/lakeFS.git,scmUrl=https://github.com/treeverse/lakeFS \ -o /mnt/clients/java -.PHONY: clients client-python client-java -clients: client-python client-java + +.PHONY: clients client-python client-java client-java-legacy +clients: client-python client-java client-java-legacy package-python: client-python $(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt -e HOME=/tmp/ -w /mnt/clients/python $(PYTHON_IMAGE) /bin/bash -c \ diff --git a/api/java-gen-ignore b/api/java-gen-ignore new file mode 100644 index 00000000000..d7c7da26666 --- /dev/null +++ b/api/java-gen-ignore @@ -0,0 +1,3 @@ +# Files to ignore (skip) when generating Java client +maven.yml +.github/ diff --git a/clients/.gitattributes b/clients/.gitattributes index bcd50e2a310..3c03a79c655 100644 --- a/clients/.gitattributes +++ b/clients/.gitattributes @@ -1,5 +1,6 @@ -java/** linguist-generated -python/** linguist-generated -python/Gemfile linguist-generated=false -python/Gemfile.lock linguist-generated=false -python/_config.yml linguist-generated=false +java/** linguist-generated +java-legacy/** linguist-generated +python/** linguist-generated +python/Gemfile linguist-generated=false +python/Gemfile.lock linguist-generated=false +python/_config.yml linguist-generated=false diff --git a/clients/hadoopfs/pom.xml b/clients/hadoopfs/pom.xml index a6efb38020e..ffa85044152 100644 --- a/clients/hadoopfs/pom.xml +++ b/clients/hadoopfs/pom.xml @@ -93,7 +93,7 @@ To export to S3: org.apache.maven.plugins maven-surefire-plugin - 2.12.4 + 3.1.2 presigned @@ -231,7 +231,7 @@ To export to S3: org.apache.maven.plugins maven-surefire-plugin - 2.12.4 + 3.1.2 ${exclude.tests} @@ -368,11 +368,24 @@ To export to S3: - org.mockito - - mockito-inline - 3.10.0 - test + org.mock-server + mockserver-junit-rule-no-dependencies + 5.14.0 + test + + + + org.immutables + value + 2.9.3 + test + + + + com.google.guava + guava + 32.1.2-jre + test diff --git a/clients/hadoopfs/src/main/java/io/lakefs/Constants.java b/clients/hadoopfs/src/main/java/io/lakefs/Constants.java index fe088347f74..f8ce1f5cb96 100644 --- a/clients/hadoopfs/src/main/java/io/lakefs/Constants.java +++ b/clients/hadoopfs/src/main/java/io/lakefs/Constants.java @@ -10,6 +10,7 @@ public class Constants { public static final String ENDPOINT_KEY_SUFFIX = "endpoint"; public static final String LIST_AMOUNT_KEY_SUFFIX = "list.amount"; public static final String ACCESS_MODE_KEY_SUFFIX = "access.mode"; + public static final String SESSION_ID = "session_id"; public static enum AccessMode { SIMPLE, diff --git a/clients/hadoopfs/src/main/java/io/lakefs/LakeFSClient.java b/clients/hadoopfs/src/main/java/io/lakefs/LakeFSClient.java index 15579946f5f..9fedf481881 100644 --- a/clients/hadoopfs/src/main/java/io/lakefs/LakeFSClient.java +++ b/clients/hadoopfs/src/main/java/io/lakefs/LakeFSClient.java @@ -41,6 +41,11 @@ public LakeFSClient(String scheme, Configuration conf) throws IOException { basicAuth.setUsername(accessKey); basicAuth.setPassword(secretKey); + String sessionId = FSConfiguration.get(conf, scheme, Constants.SESSION_ID); + if (sessionId != null) { + apiClient.addDefaultCookie("sessionId", sessionId); + } + this.objectsApi = new ObjectsApi(apiClient); this.stagingApi = new StagingApi(apiClient); this.repositoriesApi = new RepositoriesApi(apiClient); diff --git a/clients/hadoopfs/src/main/java/io/lakefs/LakeFSFileSystem.java b/clients/hadoopfs/src/main/java/io/lakefs/LakeFSFileSystem.java index 0fc5fd02ac5..5f257e30dc9 100644 --- a/clients/hadoopfs/src/main/java/io/lakefs/LakeFSFileSystem.java +++ b/clients/hadoopfs/src/main/java/io/lakefs/LakeFSFileSystem.java @@ -421,6 +421,7 @@ private boolean renameFile(LakeFSFileStatus srcStatus, Path dst) throws IOExcept LOG.debug("renameFile: dst {} exists and is a {}", dst, dstFileStatus.isDirectory() ? "directory" : "file"); if (dstFileStatus.isDirectory()) { dst = buildObjPathOnExistingDestinationDir(srcStatus.getPath(), dst); + LOG.debug("renameFile: use {} to create dst {}", srcStatus.getPath(), dst); } } catch (FileNotFoundException e) { LOG.debug("renameFile: dst does not exist, renaming src {} to a file called dst {}", diff --git a/clients/hadoopfs/src/test/java/io/lakefs/FSTestBase.java b/clients/hadoopfs/src/test/java/io/lakefs/FSTestBase.java new file mode 100644 index 00000000000..7ddc766bfd3 --- /dev/null +++ b/clients/hadoopfs/src/test/java/io/lakefs/FSTestBase.java @@ -0,0 +1,333 @@ +package io.lakefs; + +import com.amazonaws.ClientConfiguration; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.S3ClientOptions; +import com.amazonaws.services.s3.model.*; +import com.aventrix.jnanoid.jnanoid.NanoIdUtils; +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableMap; +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.model.*; +import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; +import io.lakefs.utils.ObjectLocation; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileAlreadyExistsException; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.LocatedFileStatus; +import org.apache.hadoop.fs.Path; +import org.apache.http.HttpStatus; + +import org.immutables.value.Value; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +import org.mockserver.client.MockServerClient; +import org.mockserver.junit.MockServerRule; +import org.mockserver.matchers.MatchType; +import org.mockserver.matchers.TimeToLive; +import org.mockserver.matchers.Times; +import org.mockserver.model.Cookie; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; +import org.mockserver.model.Parameter; + +import static org.apache.commons.lang3.StringUtils.removeStart; + +import static org.mockserver.model.HttpResponse.response; +import static org.mockserver.model.JsonBody.json; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.List; + +/** + * Base for all LakeFSFilesystem tests. Helps set common components up but + * contains no tests of its own. + * + * See e.g. "Base Test Class Testing Pattern: Why and How to use", + * https://eliasnogueira.com/base-test-class-testing-pattern-why-and-how-to-use/ + */ +abstract class FSTestBase { + static protected final Long UNUSED_FILE_SIZE = 1L; + static protected final Long UNUSED_MTIME = 0L; + static protected final String UNUSED_CHECKSUM = "unused"; + + static protected final Long STATUS_FILE_SIZE = 2L; + static protected final Long STATUS_MTIME = 123456789L; + static protected final String STATUS_CHECKSUM = "status"; + + protected Configuration conf; + protected final LakeFSFileSystem fs = new LakeFSFileSystem(); + + protected String s3Base; + protected String s3Bucket; + + protected static final String S3_ACCESS_KEY_ID = "AKIArootkey"; + protected static final String S3_SECRET_ACCESS_KEY = "secret/minio/key="; + + protected static final ApiException noSuchFile = new ApiException(HttpStatus.SC_NOT_FOUND, "no such file"); + + protected final Gson gson = new GsonBuilder() + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .create(); + + @Value.Immutable static public interface Pagination { + @Value.Parameter Optional amount(); + @Value.Parameter Optional after(); + @Value.Parameter Optional prefix(); + } + + @Rule + public MockServerRule mockServerRule = new MockServerRule(this); + protected MockServerClient mockServerClient; + + @Rule + public TestName name = new TestName(); + + protected String sessionId() { + return name.getMethodName(); + } + + protected HttpRequest request() { + return HttpRequest.request().withCookie(new Cookie("sessionId", sessionId())); + } + + protected static String makeS3BucketName() { + String slug = NanoIdUtils.randomNanoId(NanoIdUtils.DEFAULT_NUMBER_GENERATOR, + "abcdefghijklmnopqrstuvwxyz-0123456789".toCharArray(), 14); + return String.format("bucket-%s-x", slug); + } + + /** @return "s3://..." URL to use for s3Path (which does not start with a slash) on bucket */ + protected String s3Url(String s3Path) { + return s3Base + s3Path; + } + + protected String getS3Key(StagingLocation stagingLocation) { + return removeStart(stagingLocation.getPhysicalAddress(), s3Base); + } + + /** + * Override to add to Hadoop configuration. + */ + protected void addHadoopConfiguration(Configuration conf) { + } + + @Before + public void hadoopSetup() throws IOException, URISyntaxException { + conf = new Configuration(false); + + addHadoopConfiguration(conf); + + conf.set("fs.lakefs.impl", "io.lakefs.LakeFSFileSystem"); + + conf.set("fs.lakefs.access.key", "unused-but-checked"); + conf.set("fs.lakefs.secret.key", "unused-but-checked"); + conf.set("fs.lakefs.endpoint", String.format("http://localhost:%d/", mockServerClient.getPort())); + conf.set("fs.lakefs.session_id", sessionId()); + + System.setProperty("hadoop.home.dir", "/"); + + // lakeFSFS initialization requires a blockstore. + mockServerClient.when(request() + .withMethod("GET") + .withPath("/config/storage"), + Times.once()) + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(new StorageConfig() + .blockstoreType("s3") + .blockstoreNamespaceValidityRegex(".*") + // TODO(ariels): Change for presigned? + .preSignSupport(false)))); + + // Always allow repo "repo" to be found, it's used in all tests. + mockServerClient.when(request() + .withMethod("GET") + .withPath("/repositories/repo")) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(new Repository().id("repo") + .creationDate(1234L) + .defaultBranch("main") + // Not really needed, just put something that works. + .storageNamespace("s3a://FIX/ME?")))); + + // Don't return 404s for unknown paths - they will be emitted for + // many bad requests or mocks, and make our life difficult. Instead + // fail using a unique error code. This has very low priority. + mockServerClient.when(request(), Times.unlimited(), TimeToLive.unlimited(), -10000) + .respond(response().withStatusCode(418)); + // TODO(ariels): No tests mock "get underlying filesystem", so this + // also catches its "get repo" call. Nothing bad happens, but + // this response does show up in logs. + + moreHadoopSetup(); + + fs.initialize(new URI("lakefs://repo/main/file.txt"), conf); + } + + protected void moreHadoopSetup() {} + + // Mock this statObject call not to be found + protected void mockStatObjectNotFound(String repo, String ref, String path) { + mockServerClient.when(request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/refs/%s/objects/stat", repo, ref)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(404) + .withBody(String.format("{message: \"%s/%s/%s not found\"}", + repo, ref, path, sessionId()))); + } + + protected void mockStatObject(String repo, String ref, String path, ObjectStats stats) { + mockServerClient.when(request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/refs/%s/objects/stat", repo, ref)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(stats))); + } + + // Mock this lakeFSFS path not to exist. You may still need to + // mockListing for the directory that will not contain this path. + protected void mockFileDoesNotExist(String repo, String ref, String path) { + mockStatObjectNotFound(repo, ref, path); + mockStatObjectNotFound(repo, ref, path + Constants.SEPARATOR); + } + + protected void mockFilesInDir(String repo, String main, String dir, String... files) { + ObjectStats[] allStats; + if (files.length == 0) { + // Fake a directory marker + Path dirPath = new Path(String.format("lakefs://%s/%s/%s", repo, main, dir)); + ObjectLocation dirLoc = ObjectLocation.pathToObjectLocation(dirPath); + ObjectStats dirStats = mockDirectoryMarker(dirLoc); + allStats = new ObjectStats[1]; + allStats[0] = dirStats; + } else { + mockStatObjectNotFound(repo, main, dir); + mockStatObjectNotFound(repo, main, dir + Constants.SEPARATOR); + + allStats = new ObjectStats[files.length]; + for (int i = 0; i < files.length; i++) { + allStats[i] = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path(dir + Constants.SEPARATOR + files[i]); + } + } + + // Directory can be listed! + mockListing("repo", "main", + ImmutablePagination.builder().prefix(dir + Constants.SEPARATOR).build(), + allStats); + } + + protected void mockUploadObject(String repo, String branch, String path) { + StagingLocation stagingLocation = new StagingLocation() + .token("token:foo:" + sessionId()) + .physicalAddress(s3Url(String.format("repo-base/dir-marker/%s/%s/%s/%s", + sessionId(), repo, branch, path))); + mockServerClient.when(request() + .withMethod("POST") + .withPath(String.format("/repositories/%s/branches/%s/objects", repo, branch)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(stagingLocation))); + } + + protected void mockGetBranch(String repo, String branch) { + mockServerClient.when(request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/branches/%s", repo, branch))) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(new Ref().id("123").commitId("456")))); + } + + protected void mockDeleteObject(String repo, String branch, String path) { + mockServerClient.when(request() + .withMethod("DELETE") + .withPath(String.format("/repositories/%s/branches/%s/objects", repo, branch)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(204)); + } + + protected void mockDeleteObjectNotFound(String repo, String branch, String path) { + mockServerClient.when(request() + .withMethod("DELETE") + .withPath(String.format("/repositories/%s/branches/%s/objects", repo, branch)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(404)); + } + + // Mocks a single deleteObjects call to succeed, returning list of failures. + protected void mockDeleteObjects(String repo, String branch, String path, ObjectError... errors) { + PathList pathList = new PathList().addPathsItem(path); + mockDeleteObjects(repo, branch, pathList, errors); + } + + // Mocks a single deleteObjects call to succeed, returning list of failures. + protected void mockDeleteObjects(String repo, String branch, PathList pathList, ObjectError... errors) { + mockServerClient.when(request() + .withMethod("POST") + .withPath(String.format("/repositories/%s/branches/%s/objects/delete", repo, branch)) + .withBody(gson.toJson(pathList)), + Times.once()) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(new ObjectErrorList() + .errors(Arrays.asList(errors))))); + } + + protected ObjectStats mockDirectoryMarker(ObjectLocation objectLoc) { + // Mock parent directory to show the directory marker exists. + ObjectStats markerStats = new ObjectStats() + .path(objectLoc.getPath()) + .pathType(PathTypeEnum.OBJECT); + mockServerClient.when(request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/refs/%s/objects/stat", objectLoc.getRepository(), objectLoc.getRef())) + .withQueryStringParameter("path", objectLoc.getPath())) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(markerStats))); + return markerStats; + } + + // Mock this listing and return these stats. + protected void mockListing(String repo, String ref, ImmutablePagination pagination, ObjectStats... stats) { + mockListingWithHasMore(repo, ref, pagination, false, stats); + } + + protected void mockListingWithHasMore(String repo, String ref, ImmutablePagination pagination, boolean hasMore, ObjectStats... stats) { + HttpRequest req = request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/refs/%s/objects/ls", repo, ref)); + // Validate elements of pagination only if present. + if (pagination.after().isPresent()) { + req = req.withQueryStringParameter("after", pagination.after().or("")); + } + if (pagination.amount().isPresent()) { + req = req.withQueryStringParameter("amount", pagination.amount().get().toString()); + } + if (pagination.prefix().isPresent()) { + req = req.withQueryStringParameter("prefix", pagination.prefix().or("")); + } + mockServerClient.when(req) + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(ImmutableMap.of("results", Arrays.asList(stats), + "pagination", + new io.lakefs.clients.api.model.Pagination().hasMore(hasMore))))); + } +} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemPresignedModeTest.java b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemPresignedModeTest.java deleted file mode 100644 index e0eb9437f4b..00000000000 --- a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemPresignedModeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.lakefs; - -import static org.mockito.Mockito.when; -import java.net.URL; -import java.util.Date; -import java.util.concurrent.TimeUnit; -import com.amazonaws.HttpMethod; -import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.model.ObjectStats; -import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; -import io.lakefs.clients.api.model.StagingLocation; - -public class LakeFSFileSystemPresignedModeTest extends LakeFSFileSystemTest { - - void initConfiguration() { - conf.set("fs.lakefs.access.mode", "presigned"); - } - - StagingLocation mockGetPhysicalAddress(String repo, String branch, String key, - String physicalKey) throws ApiException { - URL url = - s3Client.generatePresignedUrl(new GeneratePresignedUrlRequest(s3Bucket, physicalKey) - .withMethod(HttpMethod.PUT).withExpiration( - new Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1)))); - StagingLocation stagingLocation = new StagingLocation().token("foo") - .physicalAddress(s3Url("/" + physicalKey)).presignedUrl(url.toString()); - when(stagingApi.getPhysicalAddress(repo, branch, key, true)).thenReturn(stagingLocation); - return stagingLocation; - } - - @Override - void mockStatObject(String repo, String branch, String key, String physicalKey, Long sizeBytes) - throws ApiException { - URL url = - s3Client.generatePresignedUrl(new GeneratePresignedUrlRequest(s3Bucket, physicalKey) - .withMethod(HttpMethod.GET).withExpiration( - new Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1)))); - when(objectsApi.statObject(repo, branch, key, false, true)) - .thenReturn(new ObjectStats().path("lakefs://" + repo + "/" + branch + "/" + key) - .pathType(PathTypeEnum.OBJECT).physicalAddress(url.toString()) - .checksum(UNUSED_CHECKSUM).mtime(UNUSED_MTIME).sizeBytes((long) sizeBytes)); - } -} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerS3Test.java b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerS3Test.java new file mode 100644 index 00000000000..cf1a88303ff --- /dev/null +++ b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerS3Test.java @@ -0,0 +1,315 @@ +package io.lakefs; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.lakefs.clients.api.model.*; +import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; +import io.lakefs.clients.api.ApiException; +import io.lakefs.utils.ObjectLocation; + +import org.apache.commons.io.IOUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileAlreadyExistsException; +import org.apache.hadoop.fs.Path; + +import com.amazonaws.HttpMethod; +import com.amazonaws.services.s3.model.*; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters;import org.hamcrest.core.StringContains; + +import org.mockserver.matchers.MatchType; + +import static org.mockserver.model.HttpResponse.response; +import static org.mockserver.model.JsonBody.json; + +import java.io.*; +import java.net.URL; +import java.util.Date; +import java.util.Arrays; +import java.util.concurrent.TimeUnit; + +@RunWith(Parameterized.class) +public class LakeFSFileSystemServerS3Test extends S3FSTestBase { + static private final Logger LOG = LoggerFactory.getLogger(LakeFSFileSystemServerS3Test.class); + + public static interface PhysicalAddressCreator { + default void initConfiguration(Configuration conf) {} + String createGetPhysicalAddress(S3FSTestBase o, String key); + StagingLocation createPutStagingLocation(S3FSTestBase o, String namespace, String repo, String branch, String path); + } + + // TODO(ariels): Improve naming per-parameter, don't name them "[0]", "[1]". + @Parameters(name="{1}") + public static Iterable data() { + return Arrays.asList(new Object[][]{ + {new SimplePhysicalAddressCreator(), "simple"}, + {new PresignedPhysicalAddressCreator(), "presigned"}}); + } + + @Parameter(1) + public String unusedAddressCreatorType; + + @Parameter(0) + public PhysicalAddressCreator pac; + + static private class SimplePhysicalAddressCreator implements PhysicalAddressCreator { + public String createGetPhysicalAddress(S3FSTestBase o, String key) { + return o.s3Url(key); + } + + public StagingLocation createPutStagingLocation(S3FSTestBase o, String namespace, String repo, String branch, String path) { + String fullPath = String.format("%s/%s/%s/%s/%s-object", + o.sessionId(), namespace, repo, branch, path); + return new StagingLocation() + .token("token:simple:" + o.sessionId()) + .physicalAddress(o.s3Url(fullPath)); + } + } + + static private class PresignedPhysicalAddressCreator implements PhysicalAddressCreator { + public void initConfiguration(Configuration conf) { + conf.set("fs.lakefs.access.mode", "presigned"); + } + + protected Date getExpiration() { + return new Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1)); + } + + public String createGetPhysicalAddress(S3FSTestBase o, String key) { + Date expiration = getExpiration(); + URL presignedUrl = + o.s3Client.generatePresignedUrl(new GeneratePresignedUrlRequest(o.s3Bucket, key) + .withMethod(HttpMethod.GET) + .withExpiration(expiration)); + return presignedUrl.toString(); + } + + public StagingLocation createPutStagingLocation(S3FSTestBase o, String namespace, String repo, String branch, String path) { + String fullPath = String.format("%s/%s/%s/%s/%s-object", + o.sessionId(), namespace, repo, branch, path); + Date expiration = getExpiration(); + URL presignedUrl = + o.s3Client.generatePresignedUrl(new GeneratePresignedUrlRequest(o.s3Bucket, fullPath) + .withMethod(HttpMethod.PUT) + .withExpiration(expiration)); + return new StagingLocation() + .token("token:presigned:" + o.sessionId()) + .physicalAddress(o.s3Url(fullPath)) + .presignedUrl(presignedUrl.toString()); + } + } + + @Override + protected void moreHadoopSetup() { + super.moreHadoopSetup(); + pac.initConfiguration(conf); + } + + // Return a location under namespace for this getPhysicalAddress call. + // + // TODO(ariels): abstract, overload separately for direct and pre-signed. + protected StagingLocation mockGetPhysicalAddress(String repo, String branch, String path, String namespace) { + StagingLocation stagingLocation = + pac.createPutStagingLocation(this, namespace, repo, branch, path); + mockServerClient.when(request() + .withMethod("GET") + .withPath(String.format("/repositories/%s/branches/%s/staging/backing", repo, branch)) + .withQueryStringParameter("path", path)) + .respond(response().withStatusCode(200) + .withBody(gson.toJson(stagingLocation))); + return stagingLocation; + } + + @Test + public void testCreate() throws IOException { + String contents = "The quick brown fox jumps over the lazy dog."; + long contentsLength = (long) contents.getBytes().length; + Path path = new Path("lakefs://repo/main/sub1/sub2/create.me"); + + mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path)); + + StagingLocation stagingLocation = + mockGetPhysicalAddress("repo", "main", "sub1/sub2/create.me", "repo-base/create"); + + // nothing at path + mockFileDoesNotExist("repo", "main", "sub1/sub2/create.me"); + // sub1/sub2 was an empty directory with no marker. + mockStatObjectNotFound("repo", "main", "sub1/sub2/"); + + ObjectStats newStats = new ObjectStats() + .path("sub1/sub2/create.me") + .pathType(PathTypeEnum.OBJECT) + .physicalAddress(stagingLocation.getPhysicalAddress()). + checksum(UNUSED_CHECKSUM). + mtime(UNUSED_MTIME). + sizeBytes(UNUSED_FILE_SIZE); + + mockServerClient.when(request() + .withMethod("PUT") + .withPath("/repositories/repo/branches/main/staging/backing") + .withBody(json(gson.toJson(new StagingMetadata() + .staging(stagingLocation) + .sizeBytes(contentsLength)), + MatchType.ONLY_MATCHING_FIELDS))) + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(newStats))); + + // Empty dir marker should be deleted. + mockDeleteObject("repo", "main", "sub1/sub2/"); + + OutputStream out = fs.create(path); + out.write(contents.getBytes()); + out.close(); + + // Write succeeded, verify physical file on S3. + assertS3Object(stagingLocation, contents); + } + + @Test + public void testMkdirs() throws IOException { + // setup empty folder checks + Path path = new Path("dir1/dir2/dir3"); + for (Path p = new Path(path.toString()); p != null && !p.isRoot(); p = p.getParent()) { + mockStatObjectNotFound("repo", "main", p.toString()); + mockStatObjectNotFound("repo", "main", p+"/"); + mockListing("repo", "main", ImmutablePagination.builder().prefix(p+"/").build()); + } + + // physical address to directory marker object + StagingLocation stagingLocation = + mockGetPhysicalAddress("repo", "main", "dir1/dir2/dir3/", "repo-base/emptyDir"); + + ObjectStats newStats = new ObjectStats() + .path("dir1/dir2/dir3/") + .physicalAddress(pac.createGetPhysicalAddress(this, "repo-base/dir12")); + mockStatObject("repo", "main", "dir1/dir2/dir3/", newStats); + + mockServerClient.when(request() + .withMethod("PUT") + .withPath("/repositories/repo/branches/main/staging/backing") + .withQueryStringParameter("path", "dir1/dir2/dir3/") + .withBody(json(gson.toJson(new StagingMetadata() + .staging(stagingLocation) + .sizeBytes(0L)), + MatchType.ONLY_MATCHING_FIELDS))) + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(newStats))); + + // call mkdirs + Assert.assertTrue(fs.mkdirs(new Path("lakefs://repo/main/", path))); + + // verify file exists on s3 + assertS3Object(stagingLocation, ""); + } + + @Test + public void testCreateExistingDirectory() throws IOException { + Path path = new Path("lakefs://repo/main/sub1/sub2/create.me"); + // path is a directory -- so cannot be created as a file. + + mockStatObjectNotFound("repo", "main", "sub1/sub2/create.me"); + ObjectStats stats = new ObjectStats() + .path("sub1/sub2/create.me/") + .physicalAddress(pac.createGetPhysicalAddress(this, "repo-base/sub1/sub2/create.me")); + mockStatObject("repo", "main", "sub1/sub2/create.me/", stats); + + Exception e = + Assert.assertThrows(FileAlreadyExistsException.class, () -> fs.create(path, false)); + Assert.assertThat(e.getMessage(), new StringContains("is a directory")); + } + + @Test + public void testCreateExistingFile() throws IOException { + Path path = new Path("lakefs://repo/main/sub1/sub2/create.me"); + + ObjectLocation dir = new ObjectLocation("lakefs", "repo", "main", "sub1/sub2"); + mockStatObject("repo", "main", "sub1/sub2/create.me", + new ObjectStats().path("sub1/sub2/create.me")); + Exception e = Assert.assertThrows(FileAlreadyExistsException.class, + () -> fs.create(path, false)); + Assert.assertThat(e.getMessage(), new StringContains("already exists")); + } + + @Test + public void testOpen() throws IOException, ApiException { + String contents = "The quick brown fox jumps over the lazy dog."; + byte[] contentsBytes = contents.getBytes(); + String physicalPath = sessionId() + "/repo-base/open"; + String physicalKey = pac.createGetPhysicalAddress(this, physicalPath); + int readBufferSize = 5; + Path path = new Path("lakefs://repo/main/read.me"); + + mockStatObject("repo", "main", "read.me", + new ObjectStats() + .physicalAddress(physicalKey) + .checksum(UNUSED_CHECKSUM) + .mtime(UNUSED_MTIME) + .sizeBytes((long) contentsBytes.length)); + + // Write physical file to S3. + ObjectMetadata s3Metadata = new ObjectMetadata(); + s3Metadata.setContentLength(contentsBytes.length); + s3Client.putObject(s3Bucket, + physicalPath, + new ByteArrayInputStream(contentsBytes), + s3Metadata); + + try (InputStream in = fs.open(path, readBufferSize)) { + String actual = IOUtils.toString(in); + Assert.assertEquals(contents, actual); + } catch (Exception e) { + String actualFiles = String.join(", ", getS3FilesByPrefix("")); + throw new RuntimeException("Files " + actualFiles + "; read " + path.toString() + " from " + physicalKey, e); + } + } + + // TODO(ariels): Rename test to "testOpenWithNonAsciiUriChars". + @Test + public void testOpenWithInvalidUriChars() throws IOException, ApiException { + String contents = "The quick brown fox jumps over the lazy dog."; + byte[] contentsBytes = contents.getBytes(); + int readBufferSize = 5; + + String[] suffixes = { + "with space/open", + "wi:th$cha&rs#/%op;e?n", + "עכשיו/בעברית/open", + "\uD83E\uDD2F/imoji/open", + }; + for (String suffix : suffixes) { + String key = "/repo-base/" + suffix; + + // Write physical file to S3. + ObjectMetadata s3Metadata = new ObjectMetadata(); + s3Metadata.setContentLength(contentsBytes.length); + s3Client.putObject(new PutObjectRequest(s3Bucket, key, new ByteArrayInputStream(contentsBytes), s3Metadata)); + + String path = String.format("lakefs://repo/main/%s-x", suffix); + ObjectStats stats = new ObjectStats() + .physicalAddress(pac.createGetPhysicalAddress(this, key)) + .sizeBytes((long) contentsBytes.length); + mockStatObject("repo", "main", suffix + "-x", stats); + + try (InputStream in = fs.open(new Path(path), readBufferSize)) { + String actual = IOUtils.toString(in); + Assert.assertEquals(contents, actual); + } + } + } + + @Test + public void testOpen_NotExists() throws IOException, ApiException { + Path path = new Path("lakefs://repo/main/doesNotExi.st"); + mockStatObjectNotFound("repo", "main", "doesNotExi.st"); + Assert.assertThrows(FileNotFoundException.class, + () -> fs.open(path)); + } +} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerTest.java b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerTest.java new file mode 100644 index 00000000000..07c75561f4a --- /dev/null +++ b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemServerTest.java @@ -0,0 +1,783 @@ +package io.lakefs; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.lakefs.clients.api.*; +import io.lakefs.clients.api.model.*; +import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; +import io.lakefs.utils.ObjectLocation; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import org.apache.commons.io.IOUtils; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.LocatedFileStatus; +import org.apache.hadoop.fs.Path; +import org.apache.http.HttpStatus; +import org.junit.Assert; +import org.junit.Test; + +import org.hamcrest.core.StringContains; + +import org.mockserver.client.MockServerClient; +import org.mockserver.matchers.TimeToLive; +import org.mockserver.matchers.Times; +import org.mockserver.model.Cookie; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; +import org.mockserver.model.Parameter; + +import static org.mockserver.model.HttpResponse.response; +import static org.mockserver.model.JsonBody.json; + +import java.io.*; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LakeFSFileSystemServerTest extends FSTestBase { + static private final Logger LOG = LoggerFactory.getLogger(LakeFSFileSystemServerTest.class); + + protected String objectLocToS3ObjKey(ObjectLocation objectLoc) { + return String.format("/%s/%s/%s",objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath()); + } + + @Test + public void getUri() { + URI u = fs.getUri(); + Assert.assertNotNull(u); + } + + @Test + public void testUnknownProperties() throws IOException { + // Verify that a response with unknown properties is still parsed. + // This allows backwards compatibility: old clients can work with + // new servers. It tests that the OpenAPI codegen gave the correct + // result, but this is still important. + // + // TODO(ariels): This test is unrelated to LakeFSFileSystem. it + // should not be part of LakeFSFileSystemTest. + Path path = new Path("lakefs://repo/main/file"); + mockServerClient.when(request() + .withMethod("GET") + .withPath("/repositories/repo/refs/main/objects/stat") + .withQueryStringParameter("path", "file")) + .respond(response() + .withStatusCode(200) + .withBody("{\"path\": \"file\", \"unknown-key\": \"ignored\"}")); + LakeFSFileStatus fileStatus = fs.getFileStatus(path); + Assert.assertEquals(path, fileStatus.getPath()); + } + + @Test + public void testGetFileStatus_ExistingFile() throws IOException { + Path path = new Path("lakefs://repo/main/mock/exists"); + mockServerClient.when(request() + .withMethod("GET") + .withPath("/repositories/repo/refs/main/objects/stat") + .withQueryStringParameter("path", "mock/exists")) + // TODO(ariels) mockStatObject()! + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(new ObjectStats().path("mock/exists")))); + LakeFSFileStatus fileStatus = fs.getFileStatus(path); + Assert.assertTrue(fileStatus.isFile()); + Assert.assertEquals(path, fileStatus.getPath()); + } + + @Test + public void testGetFileStatus_NoFile() { + Path noFilePath = new Path("lakefs://repo/main/no.file"); + + mockStatObjectNotFound("repo", "main", "no.file"); + mockStatObjectNotFound("repo", "main", "no.file/"); + mockListing("repo", "main", ImmutablePagination.builder().prefix("no.file/").amount(1).build()); + Assert.assertThrows(FileNotFoundException.class, () -> fs.getFileStatus(noFilePath)); + } + + @Test + public void testGetFileStatus_DirectoryMarker() throws IOException { + Path dirPath = new Path("lakefs://repo/main/dir1/dir2"); + mockStatObjectNotFound("repo", "main", "dir1/dir2"); + + ObjectStats stats = new ObjectStats() + .path("dir1/dir2/") + .physicalAddress(s3Url("repo-base/dir12")); + mockStatObject("repo", "main", "dir1/dir2/", stats); + + LakeFSFileStatus dirStatus = fs.getFileStatus(dirPath); + Assert.assertTrue(dirStatus.isDirectory()); + Assert.assertEquals(dirPath, dirStatus.getPath()); + } + + @Test + public void testExists_ExistsAsObject() throws IOException { + Path path = new Path("lakefs://repo/main/exis.ts"); + ObjectStats stats = new ObjectStats() + .path("exis.ts") + .physicalAddress(s3Url("repo-base/o12")); + mockListing("repo", "main", ImmutablePagination.builder().prefix("exis.ts").build(), stats); + Assert.assertTrue(fs.exists(path)); + } + + @Test + public void testExists_ExistsAsDirectoryMarker() throws IOException { + Path path = new Path("lakefs://repo/main/exis.ts"); + ObjectStats stats = new ObjectStats().path("exis.ts"); + + mockListing("repo", "main", ImmutablePagination.builder().prefix("exis.ts").build(), + stats); + + Assert.assertTrue(fs.exists(path)); + } + + @Test + public void testExists_ExistsAsDirectoryContents() throws IOException { + Path path = new Path("lakefs://repo/main/exis.ts"); + ObjectStats stats = new ObjectStats().path("exis.ts/object-inside-the-path"); + + mockListing("repo", "main", ImmutablePagination.builder().prefix("exis.ts").build(), + stats); + Assert.assertTrue(fs.exists(path)); + } + + @Test + public void testExists_ExistsAsDirectoryInSecondList() throws IOException { + Path path = new Path("lakefs://repo/main/exis.ts"); + ObjectStats beforeStats1 = new ObjectStats().path("exis.ts!"); + ObjectStats beforeStats2 = new ObjectStats().path("exis.ts$x"); + ObjectStats indirStats = new ObjectStats().path("exis.ts/object-inside-the-path"); + + // First listing returns irrelevant objects, _before_ "exis.ts/" + mockListingWithHasMore("repo", "main", + ImmutablePagination.builder().prefix("exis.ts").build(), + true, + beforeStats1, beforeStats2); + // Second listing tries to find an object inside "exis.ts/". + mockListing("repo", "main", ImmutablePagination.builder().prefix("exis.ts/").build(), + indirStats); + Assert.assertTrue(fs.exists(path)); + } + + @Test + public void testExists_NotExistsNoPrefix() throws IOException { + Path path = new Path("lakefs://repo/main/doesNotExi.st"); + Object emptyBody = ImmutableMap.of("results", ImmutableList.of(), + "pagination", ImmutablePagination.builder().build()); + mockServerClient.when(request() + .withMethod("GET") + .withPath("/repositories/repo/refs/main/objects/ls")) + .respond(response() + .withStatusCode(200) + .withBody(gson.toJson(emptyBody))); + Assert.assertFalse(fs.exists(path)); + } + + @Test + public void testExists_NotExistsPrefixWithNoSlash() { + // TODO(ariels) + } + + @Test + public void testExists_NotExistsPrefixWithNoSlashTwoLists() { + // TODO(ariels) + } + + @Test + public void testDelete_FileExists() throws IOException { + mockStatObject("repo", "main", "no/place/file.txt", new ObjectStats() + .path("delete/sample/file.txt") + .pathType(PathTypeEnum.OBJECT) + .physicalAddress(s3Url("repo-base/delete"))); + String[] arrDirs = {"no/place", "no"}; + for (String dir: arrDirs) { + mockStatObjectNotFound("repo", "main", dir); + mockStatObjectNotFound("repo", "main", dir + "/"); + mockListing("repo", "main", ImmutablePagination.builder().build()); + } + mockDeleteObject("repo", "main", "no/place/file.txt"); + mockUploadObject("repo", "main", "no/place/"); + + Path path = new Path("lakefs://repo/main/no/place/file.txt"); + + mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path.getParent())); + + Assert.assertTrue(fs.delete(path, false)); + } + + @Test + public void testDelete_FileNotExists() throws IOException { + mockDeleteObjectNotFound("repo", "main", "no/place/file.txt"); + mockStatObjectNotFound("repo", "main", "no/place/file.txt"); + mockStatObjectNotFound("repo", "main", "no/place/file.txt/"); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("no/place/file.txt/").build()); + + // Should still create a directory marker! + mockUploadObject("repo", "main", "no/place/"); + + // return false because file not found + Assert.assertFalse(fs.delete(new Path("lakefs://repo/main/no/place/file.txt"), false)); + } + + @Test + public void testDelete_EmptyDirectoryExists() throws IOException { + ObjectLocation dirObjLoc = new ObjectLocation("lakefs", "repo", "main", "delete/me"); + String key = objectLocToS3ObjKey(dirObjLoc); + + mockStatObjectNotFound(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath()); + ObjectStats srcStats = new ObjectStats() + .path(dirObjLoc.getPath() + Constants.SEPARATOR) + .sizeBytes(0L) + .mtime(UNUSED_MTIME) + .pathType(PathTypeEnum.OBJECT) + .physicalAddress(s3Url(key+Constants.SEPARATOR)) + .checksum(UNUSED_CHECKSUM); + mockStatObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath() + Constants.SEPARATOR, srcStats); + + // Just a directory marker delete/me/, so nothing to delete. + mockListing("repo", "main", + ImmutablePagination.builder().prefix("delete/me/").build(), + srcStats); + + mockDirectoryMarker(dirObjLoc.getParent()); + mockStatObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath(), srcStats); + mockDeleteObject("repo", "main", "delete/me/"); + // Now need to create the parent directory. + mockUploadObject("repo", "main", "delete/"); + + Path path = new Path("lakefs://repo/main/delete/me"); + + Assert.assertTrue(fs.delete(path, false)); + } + + @Test + public void testDelete_DirectoryWithFile() throws IOException { + String directoryPath = "delete/sample"; + String existingPath = "delete/sample/file.txt"; + String directoryToDelete = "lakefs://repo/main/delete/sample"; + mockStatObjectNotFound("repo", "main", directoryPath); + mockStatObjectNotFound("repo", "main", directoryPath + Constants.SEPARATOR); + // Just a single object under delete/sample/, not even a directory + // marker for delete/sample/. + ObjectStats srcStats = new ObjectStats(). + path(existingPath). + pathType(PathTypeEnum.OBJECT). + physicalAddress(s3Url("/repo-base/delete")). + checksum(UNUSED_CHECKSUM). + mtime(UNUSED_MTIME). + sizeBytes(UNUSED_FILE_SIZE); + mockListing("repo", "main", + ImmutablePagination.builder() + .prefix(directoryPath + Constants.SEPARATOR) + .build(), + srcStats); + + // No deletes! + mockServerClient.when(request() + .withMethod("DELETE")) + .respond(response().withStatusCode(400).withBody("Should not delete anything")); + + // Can't delete a directory without recursive, and + // delete/sample/file.txt is not deleted. + Exception e = + Assert.assertThrows(IOException.class, + () -> fs.delete(new Path(directoryToDelete), false)); + String failureMessage = + String.format("Path is a non-empty directory: %s", directoryToDelete); + Assert.assertThat(e.getMessage(), new StringContains(failureMessage)); + } + + @Test + public void testDelete_NotExistsRecursive() throws IOException { + // No objects to stat. + mockServerClient.when(request() + .withMethod("GET") + .withPath("/repositories/repo/refs/main/objects/stat")) + .respond(response().withStatusCode(404)); + // No objects to list, either -- in directory. + mockListing("repo", "main", + ImmutablePagination.builder().prefix("no/place/file.txt/").build()); + Assert.assertFalse(fs.delete(new Path("lakefs://repo/main/no/place/file.txt"), true)); + } + + @Test + public void testDelete_DirectoryWithFileRecursive() throws IOException { + mockStatObjectNotFound("repo", "main", "delete/sample"); + mockStatObjectNotFound("repo", "main", "delete/sample/"); + ObjectStats stats = new ObjectStats(). + path("delete/sample/file.txt"). + pathType(PathTypeEnum.OBJECT). + physicalAddress(s3Url("/repo-base/delete")). + checksum(UNUSED_CHECKSUM). + mtime(UNUSED_MTIME). + sizeBytes(UNUSED_FILE_SIZE); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("delete/sample/").build(), + stats); + + mockDeleteObjects("repo", "main", "delete/sample/file.txt"); + + // recursive will always end successfully + Path path = new Path("lakefs://repo/main/delete/sample"); + + mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path.getParent())); + // Must create a parent directory marker: it wasn't deleted, and now + // perhaps is empty. + mockUploadObject("repo", "main", "delete/"); + + boolean delete = fs.delete(path, true); + Assert.assertTrue(delete); + } + + protected void caseDeleteDirectoryRecursive(int bulkSize, int numObjects) throws IOException { + conf.setInt(LakeFSFileSystem.LAKEFS_DELETE_BULK_SIZE, bulkSize); + mockStatObjectNotFound("repo", "main", "delete/sample"); + mockStatObjectNotFound("repo", "main", "delete/sample/"); + + ObjectStats[] objects = new ObjectStats[numObjects]; + for (int i = 0; i < numObjects; i++) { + objects[i] = new ObjectStats(). + path(String.format("delete/sample/file%04d.txt", i)). + pathType(PathTypeEnum.OBJECT). + physicalAddress(s3Url(String.format("/repo-base/delete%04d", i))). + checksum(UNUSED_CHECKSUM). + mtime(UNUSED_MTIME). + sizeBytes(UNUSED_FILE_SIZE); + } + mockListing("repo", "main", + ImmutablePagination.builder().prefix("delete/sample/").build(), + objects); + + // Set up multiple deleteObjects expectations of bulkSize deletes + // each (except for the last, which might be smaller). + for (int start = 0; start < numObjects; start += bulkSize) { + PathList pl = new PathList(); + for (int i = start; i < numObjects && i < start + bulkSize; i++) { + pl.addPathsItem(String.format("delete/sample/file%04d.txt", i)); + } + mockDeleteObjects("repo", "main", pl); + } + // Mock parent directory marker creation at end of fs.delete to show + // the directory marker exists. + mockUploadObject("repo", "main", "delete/"); + // recursive will always end successfully + Assert.assertTrue(fs.delete(new Path("lakefs://repo/main/delete/sample"), true)); + } + + @Test + public void testDeleteDirectoryRecursiveBatch1() throws IOException { + caseDeleteDirectoryRecursive(1, 123); + } + + @Test + public void testDeleteDirectoryRecursiveBatch2() throws IOException { + caseDeleteDirectoryRecursive(2, 123); + } + + @Test + public void testDeleteDirectoryRecursiveBatch3() throws IOException { + caseDeleteDirectoryRecursive(3, 123); + } + @Test + public void testDeleteDirectoryRecursiveBatch5() throws IOException { + caseDeleteDirectoryRecursive(5, 123); + } + @Test + public void testDeleteDirectoryRecursiveBatch120() throws IOException { + caseDeleteDirectoryRecursive(120, 123); + } + @Test + public void testDeleteDirectoryRecursiveBatch123() throws IOException { + caseDeleteDirectoryRecursive(123, 123); + } + + @Test + public void testListStatusFile() throws IOException { + ObjectStats objectStats = new ObjectStats(). + path("status/file"). + pathType(PathTypeEnum.OBJECT). + physicalAddress(s3Url("/repo-base/status")). + checksum(STATUS_CHECKSUM). + mtime(STATUS_MTIME). + sizeBytes(STATUS_FILE_SIZE); + mockStatObject("repo", "main", "status/file", objectStats); + Path path = new Path("lakefs://repo/main/status/file"); + FileStatus[] fileStatuses = fs.listStatus(path); + LakeFSFileStatus expectedFileStatus = new LakeFSFileStatus.Builder(path) + .length(STATUS_FILE_SIZE) + .checksum(STATUS_CHECKSUM) + .mTime(STATUS_MTIME) + .physicalAddress(s3Url("/repo-base/status")) + .blockSize(Constants.DEFAULT_BLOCK_SIZE) + .build(); + LakeFSFileStatus[] expectedFileStatuses = new LakeFSFileStatus[]{expectedFileStatus}; + Assert.assertArrayEquals(expectedFileStatuses, fileStatuses); + } + + @Test + public void testListStatusNotFound() throws ApiException { + mockStatObjectNotFound("repo", "main", "status/file"); + mockStatObjectNotFound("repo", "main", "status/file/"); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("status/file/").build()); + Path path = new Path("lakefs://repo/main/status/file"); + Assert.assertThrows(FileNotFoundException.class, () -> fs.listStatus(path)); + } + + @Test + public void testListStatusDirectory() throws IOException { + int totalObjectsCount = 3; + ObjectStats[] objects = new ObjectStats[3]; + for (int i = 0; i < totalObjectsCount; i++) { + objects[i] = new ObjectStats(). + path("status/file" + i). + pathType(PathTypeEnum.OBJECT). + physicalAddress(s3Url("/repo-base/status" + i)). + checksum(STATUS_CHECKSUM). + mtime(STATUS_MTIME). + sizeBytes(STATUS_FILE_SIZE); + } + mockListing("repo", "main", + ImmutablePagination.builder().prefix("status/").build(), + objects); + mockStatObjectNotFound("repo", "main", "status"); + + Path dir = new Path("lakefs://repo/main/status"); + FileStatus[] fileStatuses = fs.listStatus(dir); + + FileStatus[] expectedFileStatuses = new LocatedFileStatus[totalObjectsCount]; + for (int i = 0; i < totalObjectsCount; i++) { + Path p = new Path(dir + "/file" + i); + LakeFSFileStatus fileStatus = new LakeFSFileStatus.Builder(p) + .length(STATUS_FILE_SIZE) + .checksum(STATUS_CHECKSUM) + .mTime(STATUS_MTIME) + .blockSize(Constants.DEFAULT_BLOCK_SIZE) + .physicalAddress(s3Url("/repo-base/status" + i)) + .build(); + expectedFileStatuses[i] = new LocatedFileStatus(fileStatus, null); + } + Assert.assertArrayEquals(expectedFileStatuses, fileStatuses); + } + + @Test(expected = UnsupportedOperationException.class) + public void testAppend() throws IOException { + fs.append(null, 0, null); + } + + /** + * rename(src.txt, non-existing-dst) -> non-existing/new - unsupported, should fail with false. (Test was buggy, FIX!) + */ + @Test + public void testRename_existingFileToNonExistingDst() throws IOException, ApiException { + Path src = new Path("lakefs://repo/main/existing.src"); + + ObjectStats stats = new ObjectStats() + .path("existing.src") + .sizeBytes(STATUS_FILE_SIZE) + .mtime(STATUS_MTIME) + .pathType(PathTypeEnum.OBJECT) + .physicalAddress(s3Url("existing.src")) + .checksum(STATUS_CHECKSUM); + + mockStatObject("repo", "main", "existing.src", stats); + + Path dst = new Path("lakefs://repo/main/non-existing/new"); + + mockListing("repo", "main", + ImmutablePagination.builder().prefix("non-existing/").build()); + mockStatObjectNotFound("repo", "main", "non-existing/new"); + mockStatObjectNotFound("repo", "main", "non-existing/new/"); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("non-existing/new/").build()); + mockStatObjectNotFound("repo", "main", "non-existing"); + mockStatObjectNotFound("repo", "main", "non-existing/"); + + boolean renamed = fs.rename(src, dst); + Assert.assertFalse(renamed); + } + + @Test + public void testRename_existingFileToExistingFileName() throws IOException { + Path src = new Path("lakefs://repo/main/existing.src"); + ObjectStats srcStats = new ObjectStats() + .path("existing.src") + .pathType(PathTypeEnum.OBJECT) + .physicalAddress("base/existing.src"); + mockStatObject("repo", "main", "existing.src", srcStats); + + Path dst = new Path("lakefs://repo/main/existing.dst"); + ObjectStats dstStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing.dst") + .physicalAddress(s3Url("existing.dst")); + mockStatObject("repo", "main", "existing.dst", dstStats); + + mockServerClient.when(request() + .withMethod("POST") + .withPath("/repositories/repo/branches/main/objects/copy") + .withQueryStringParameter("dest_path", "existing.dst") + .withBody(json(gson.toJson(new ObjectCopyCreation() + .srcRef("main") + .srcPath("existing.src"))))) + .respond(response() + .withStatusCode(201) + // Actual new dstStats will be different... but lakeFSFS doesn't care. + .withBody(json(gson.toJson(dstStats)))); + + mockDeleteObject("repo", "main", "existing.src"); + + Assert.assertTrue(fs.rename(src, dst)); + } + + @Test + public void testRename_existingDirToExistingFileName() throws IOException { + Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); + ObjectStats srcStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing-dir/existing.src"); + Path srcDir = new Path("lakefs://repo/main/existing-dir"); + mockStatObjectNotFound("repo", "main", "existing-dir"); + mockStatObjectNotFound("repo", "main", "existing-dir/"); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("existing-dir/").build(), + srcStats); + + Path dst = new Path("lakefs://repo/main/existingdst.file"); + ObjectStats dstStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existingdst.file"); + mockStatObject("repo", "main", "existingdst.file", dstStats); + + Assert.assertFalse(fs.rename(srcDir, dst)); + } + + /** + * file -> existing-directory-name: rename(src.txt, existing-dstdir) -> existing-dstdir/src.txt + */ + @Test + public void testRename_existingFileToExistingDirName() throws ApiException, IOException { + Path src = new Path("lakefs://repo/main/existing-dir1/existing.src"); + ObjectStats srcStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing-dir1/existing.src"); + mockStatObject("repo", "main", "existing-dir1/existing.src", srcStats); + + ObjectStats dstStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing-dir2/existing.src"); + mockFileDoesNotExist("repo", "main", "existing-dir2"); + mockFileDoesNotExist("repo", "main", "existing-dir2/"); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("existing-dir2/").build(), + dstStats); + + Path dst = new Path("lakefs://repo/main/existing-dir2/"); + + mockServerClient.when(request() + .withMethod("POST") + .withPath("/repositories/repo/branches/main/objects/copy") + .withQueryStringParameter("dest_path", "existing-dir2/existing.src") + .withBody(json(gson.toJson(new ObjectCopyCreation() + .srcRef("main") + .srcPath("existing-dir1/existing.src"))))) + .respond(response() + .withStatusCode(201) + // Actual new dstStats will be different... but lakeFSFS doesn't care. + .withBody(json(gson.toJson(dstStats)))); + mockGetBranch("repo", "main"); + mockDeleteObject("repo", "main", "existing-dir1/existing.src"); + + // Need a directory marker at the source because it's now empty! + mockUploadObject("repo", "main", "existing-dir1/"); + + Assert.assertTrue(fs.rename(src, dst)); + } + + /** + * rename(srcDir(containing srcDir/a.txt, srcDir/b.txt), non-existing-dir/new) -> unsupported, rename should fail by returning false + */ + @Test + public void testRename_existingDirToNonExistingDirWithoutParent() throws IOException { + Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); + Path srcDir = new Path("lakefs://repo/main/existing-dir"); + + mockFilesInDir("repo", "main", "existing-dir", "existing.src"); + + mockFileDoesNotExist("repo", "main", "x/non-existing-dir"); + mockFileDoesNotExist("repo", "main", "x/non-existing-dir/new"); + // Will also check if parent of destination is a directory (it isn't). + mockListing("repo", "main", + ImmutablePagination.builder().prefix("x/non-existing-dir/").build()); + mockListing("repo", "main", + ImmutablePagination.builder().prefix("x/non-existing-dir/new/").build()); + + // Keep a directory marker, or rename will try to create one because + // it emptied the existing directory. + mockStatObject("repo", "main", "x", + new ObjectStats().pathType(PathTypeEnum.OBJECT).path("x")); + + Path dst = new Path("lakefs://repo/main/x/non-existing-dir/new"); + + Assert.assertFalse(fs.rename(srcDir, dst)); + } + + /** + * rename(srcDir(containing srcDir/a.txt, srcDir/b.txt), non-existing-dir/new) -> unsupported, rename should fail by returning false + */ + @Test + public void testRename_existingDirToNonExistingDirWithParent() throws ApiException, IOException { + Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); + Path srcDir = new Path("lakefs://repo/main/existing-dir"); + Path dst = new Path("lakefs://repo/main/existing-dir2/new"); + + ObjectStats srcStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing-dir/existing.src"); + + mockStatObjectNotFound("repo", "main", "existing-dir"); + mockStatObjectNotFound("repo", "main", "existing-dir/"); + mockListing("repo", "main", ImmutablePagination.builder().prefix("existing-dir/").build(), + srcStats); + + mockStatObjectNotFound("repo", "main", "existing-dir2"); + mockStatObject("repo", "main", "existing-dir2/", + new ObjectStats().pathType(PathTypeEnum.OBJECT).path("existing-dir2/")); + + mockStatObjectNotFound("repo", "main", "existing-dir2/new"); + mockStatObjectNotFound("repo", "main", "existing-dir2/new/"); + mockListing("repo", "main", ImmutablePagination.builder().prefix("existing-dir2/new/").build()); + + ObjectStats dstStats = new ObjectStats() + .pathType(PathTypeEnum.OBJECT) + .path("existing-dir2/new/existing.src"); + + mockServerClient.when(request() + .withMethod("POST") + .withPath("/repositories/repo/branches/main/objects/copy") + .withQueryStringParameter("dest_path", "existing-dir2/new/existing.src") + .withBody(json(gson.toJson(new ObjectCopyCreation() + .srcRef("main") + .srcPath("existing-dir/existing.src"))))) + .respond(response() + .withStatusCode(201) + .withBody(json(gson.toJson(dstStats)))); + mockDeleteObject("repo", "main", "existing-dir/existing.src"); + // Directory marker no longer required. + mockDeleteObject("repo", "main", "existing-dir2/"); + + boolean renamed = fs.rename(srcDir, dst); + Assert.assertTrue(renamed); + } + + // /** + // * rename(srcDir(containing srcDir/a.txt), existing-nonempty-dstdir) -> unsupported, rename should fail by returning false. + // */ + // @Test + // public void testRename_existingDirToExistingNonEmptyDirName() throws ApiException, IOException { + // Path firstSrcFile = new Path("lakefs://repo/main/existing-dir1/a.src"); + // ObjectLocation firstObjLoc = fs.pathToObjectLocation(firstSrcFile); + // Path secSrcFile = new Path("lakefs://repo/main/existing-dir1/b.src"); + // ObjectLocation secObjLoc = fs.pathToObjectLocation(secSrcFile); + + // Path srcDir = new Path("lakefs://repo/main/existing-dir1"); + // ObjectLocation srcDirObjLoc = fs.pathToObjectLocation(srcDir); + // mockExistingDirPath(srcDirObjLoc, ImmutableList.of(firstObjLoc, secObjLoc)); + + // Path fileInDstDir = new Path("lakefs://repo/main/existing-dir2/file.dst"); + // ObjectLocation dstFileObjLoc = fs.pathToObjectLocation(fileInDstDir); + // Path dstDir = new Path("lakefs://repo/main/existing-dir2"); + // ObjectLocation dstDirObjLoc = fs.pathToObjectLocation(dstDir); + // mockExistingDirPath(dstDirObjLoc, ImmutableList.of(dstFileObjLoc)); + + // boolean renamed = fs.rename(srcDir, dstDir); + // Assert.assertFalse(renamed); + // } + + // /** + // * Check that a file is renamed when working against a lakeFS version + // * where CopyObject API doesn't exist + // */ + // @Test + // public void testRename_fallbackStageAPI() throws ApiException, IOException { + // Path src = new Path("lakefs://repo/main/existing-dir1/existing.src"); + // ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); + // mockExistingFilePath(srcObjLoc); + + // Path fileInDstDir = new Path("lakefs://repo/main/existing-dir2/existing.src"); + // ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInDstDir); + // Path dst = new Path("lakefs://repo/main/existing-dir2"); + // ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); + + // mockExistingDirPath(dstObjLoc, ImmutableList.of(fileObjLoc)); + // mockDirectoryMarker(fs.pathToObjectLocation(src.getParent())); + // mockMissingCopyAPI(); + + // boolean renamed = fs.rename(src, dst); + // Assert.assertTrue(renamed); + // Path expectedDstPath = new Path("lakefs://repo/main/existing-dir2/existing.src"); + // Assert.assertTrue(dstPathLinkedToSrcPhysicalAddress(srcObjLoc, fs.pathToObjectLocation(expectedDstPath))); + // verifyObjDeletion(srcObjLoc); + // } + + // @Test + // public void testRename_srcAndDstOnDifferentBranch() throws IOException, ApiException { + // Path src = new Path("lakefs://repo/branch/existing.src"); + // Path dst = new Path("lakefs://repo/another-branch/existing.dst"); + // boolean renamed = fs.rename(src, dst); + // Assert.assertFalse(renamed); + // Mockito.verify(objectsApi, never()).statObject(any(), any(), any(), any(), any()); + // Mockito.verify(objectsApi, never()).copyObject(any(), any(), any(), any()); + // Mockito.verify(objectsApi, never()).deleteObject(any(), any(), any()); + // } + + // /** + // * no-op. rename is expected to succeed. + // */ + // @Test + // public void testRename_srcEqualsDst() throws IOException, ApiException { + // Path src = new Path("lakefs://repo/main/existing.src"); + // Path dst = new Path("lakefs://repo/main/existing.src"); + // boolean renamed = fs.rename(src, dst); + // Assert.assertTrue(renamed); + // Mockito.verify(objectsApi, never()).statObject(any(), any(), any(), any(), any()); + // Mockito.verify(objectsApi, never()).copyObject(any(), any(), any(), any()); + // Mockito.verify(objectsApi, never()).deleteObject(any(), any(), any()); + // } + + // @Test + // public void testRename_nonExistingSrcFile() throws ApiException, IOException { + // Path src = new Path("lakefs://repo/main/non-existing.src"); + // ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); + // mockNonExistingPath(srcObjLoc); + + // Path dst = new Path("lakefs://repo/main/existing.dst"); + // ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); + // mockExistingFilePath(dstObjLoc); + + // boolean success = fs.rename(src, dst); + // Assert.assertFalse(success); + // } + + // /** + // * globStatus is used only by the Hadoop CLI where the pattern is always the exact file. + // */ + // @Test + // public void testGlobStatus_SingleFile() throws ApiException, IOException { + // Path path = new Path("lakefs://repo/main/existing.dst"); + // ObjectLocation dstObjLoc = fs.pathToObjectLocation(path); + // mockExistingFilePath(dstObjLoc); + + // FileStatus[] statuses = fs.globStatus(path); + // Assert.assertArrayEquals(new FileStatus[]{ + // new LakeFSFileStatus.Builder(path).build() + // }, statuses); + // } +} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemSimpleModeTest.java b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemSimpleModeTest.java deleted file mode 100644 index 715f0fefb4b..00000000000 --- a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemSimpleModeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.lakefs; - -import static org.mockito.Mockito.when; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.model.ObjectStats; -import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; -import io.lakefs.clients.api.model.StagingLocation; - -public class LakeFSFileSystemSimpleModeTest extends LakeFSFileSystemTest { - - @Override - void initConfiguration() {} - - @Override - StagingLocation mockGetPhysicalAddress(String repo, String branch, String key, - String physicalKey) throws ApiException { - StagingLocation stagingLocation = - new StagingLocation().token("foo").physicalAddress(s3Url("/" + physicalKey)); - when(stagingApi.getPhysicalAddress(repo, branch, key, false)).thenReturn(stagingLocation); - return stagingLocation; - } - - @Override - void mockStatObject(String repo, String branch, String key, String physicalKey, Long sizeBytes) - throws ApiException { - when(objectsApi.statObject(repo, branch, key, false, false)) - .thenReturn(new ObjectStats().path("lakefs://" + repo + "/" + branch + "/" + key).pathType(PathTypeEnum.OBJECT) - .physicalAddress(s3Url(physicalKey)).checksum(UNUSED_CHECKSUM).mtime(UNUSED_MTIME) - .sizeBytes((long) sizeBytes)); - } -} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemTest.java b/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemTest.java deleted file mode 100644 index 05c2774efbb..00000000000 --- a/clients/hadoopfs/src/test/java/io/lakefs/LakeFSFileSystemTest.java +++ /dev/null @@ -1,1079 +0,0 @@ -package io.lakefs; - -import io.lakefs.clients.api.*; -import io.lakefs.clients.api.model.*; -import io.lakefs.clients.api.model.ObjectStats.PathTypeEnum; -import io.lakefs.utils.ObjectLocation; - -import com.amazonaws.ClientConfiguration; -import com.amazonaws.auth.AWSCredentials; -import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.AmazonS3Client; -import com.amazonaws.services.s3.S3ClientOptions; -import com.amazonaws.services.s3.model.*; -import com.aventrix.jnanoid.jnanoid.NanoIdUtils; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import org.apache.commons.io.IOUtils; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FileAlreadyExistsException; -import org.apache.hadoop.fs.FileStatus; -import org.apache.hadoop.fs.LocatedFileStatus; -import org.apache.hadoop.fs.Path; -import org.apache.http.HttpStatus; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.mockito.Answers; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.utility.DockerImageName; - -import java.io.*; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.*; - -public abstract class LakeFSFileSystemTest { - static final Long UNUSED_FILE_SIZE = 1L; - static final Long UNUSED_MTIME = 0L; - static final String UNUSED_CHECKSUM = "unused"; - - static final Long STATUS_FILE_SIZE = 2L; - static final Long STATUS_MTIME = 0L; - static final String STATUS_CHECKSUM = "status"; - - protected Configuration conf; - protected final LakeFSFileSystem fs = new LakeFSFileSystem(); - - protected LakeFSClient lfsClient; - protected ObjectsApi objectsApi; - protected BranchesApi branchesApi; - protected RepositoriesApi repositoriesApi; - protected StagingApi stagingApi; - protected ConfigApi configApi; - - protected AmazonS3 s3Client; - - protected String s3Base; - protected String s3Bucket; - - private static final DockerImageName MINIO = DockerImageName.parse("minio/minio:RELEASE.2021-06-07T21-40-51Z"); - protected static final String S3_ACCESS_KEY_ID = "AKIArootkey"; - protected static final String S3_SECRET_ACCESS_KEY = "secret/minio/key="; - - protected static final ApiException noSuchFile = new ApiException(HttpStatus.SC_NOT_FOUND, "no such file"); - - @Rule - public final GenericContainer s3 = new GenericContainer(MINIO.toString()). - withCommand("minio", "server", "/data"). - withEnv("MINIO_ROOT_USER", S3_ACCESS_KEY_ID). - withEnv("MINIO_ROOT_PASSWORD", S3_SECRET_ACCESS_KEY). - withEnv("MINIO_DOMAIN", "s3.local.lakefs.io"). - withEnv("MINIO_UPDATE", "off"). - withExposedPorts(9000); - - abstract void initConfiguration(); - - abstract void mockStatObject(String repo, String branch, String key, String physicalKey, Long sizeBytes) throws ApiException; - - abstract StagingLocation mockGetPhysicalAddress(String repo, String branch, String key, String physicalKey) throws ApiException; - - protected static String makeS3BucketName() { - String slug = NanoIdUtils.randomNanoId(NanoIdUtils.DEFAULT_NUMBER_GENERATOR, - "abcdefghijklmnopqrstuvwxyz-0123456789".toCharArray(), 14); - return String.format("bucket-%s-x", slug); - } - - /** @return "s3://..." URL to use for s3Path (which does not start with a slash) on bucket */ - protected String s3Url(String s3Path) { - return s3Base + s3Path; - } - - @Before - public void logS3Container() { - Logger s3Logger = LoggerFactory.getLogger("s3 container"); - Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(s3Logger) - .withMdc("container", "s3") - .withSeparateOutputStreams(); - s3.followOutput(logConsumer); - } - - @Before - public void setUp() throws Exception { - AWSCredentials creds = new BasicAWSCredentials(S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY); - - ClientConfiguration clientConfiguration = new ClientConfiguration() - .withSignerOverride("AWSS3V4SignerType"); - String s3Endpoint = String.format("http://s3.local.lakefs.io:%d", s3.getMappedPort(9000)); - - s3Client = new AmazonS3Client(creds, clientConfiguration); - - S3ClientOptions s3ClientOptions = new S3ClientOptions() - .withPathStyleAccess(true); - s3Client.setS3ClientOptions(s3ClientOptions); - s3Client.setEndpoint(s3Endpoint); - - s3Bucket = makeS3BucketName(); - s3Base = String.format("s3://%s", s3Bucket); - CreateBucketRequest cbr = new CreateBucketRequest(s3Bucket); - s3Client.createBucket(cbr); - - conf = new Configuration(false); - initConfiguration(); - conf.set("fs.lakefs.impl", "io.lakefs.LakeFSFileSystem"); - - conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem"); - conf.set(org.apache.hadoop.fs.s3a.Constants.ACCESS_KEY, S3_ACCESS_KEY_ID); - conf.set(org.apache.hadoop.fs.s3a.Constants.SECRET_KEY, S3_SECRET_ACCESS_KEY); - conf.set(org.apache.hadoop.fs.s3a.Constants.ENDPOINT, s3Endpoint); - conf.set(org.apache.hadoop.fs.s3a.Constants.BUFFER_DIR, "/tmp/s3a"); - - System.setProperty("hadoop.home.dir", "/"); - - // Return the *same* mock for each client. Otherwise it is too hard - // to program _which_ client should do *what*. There is no risk of - // blocking, this client is synchronous. - - lfsClient = mock(LakeFSClient.class, Answers.RETURNS_SMART_NULLS); - objectsApi = mock(ObjectsApi.class, Answers.RETURNS_SMART_NULLS); - when(lfsClient.getObjectsApi()).thenReturn(objectsApi); - branchesApi = mock(BranchesApi.class, Answers.RETURNS_SMART_NULLS); - when(lfsClient.getBranchesApi()).thenReturn(branchesApi); - repositoriesApi = mock(RepositoriesApi.class, Answers.RETURNS_SMART_NULLS); - when(lfsClient.getRepositoriesApi()).thenReturn(repositoriesApi); - stagingApi = mock(StagingApi.class, Answers.RETURNS_SMART_NULLS); - when(lfsClient.getStagingApi()).thenReturn(stagingApi); - configApi = mock(ConfigApi.class, Answers.RETURNS_SMART_NULLS); - when(lfsClient.getConfigApi()).thenReturn(configApi); - when(configApi.getStorageConfig()) - .thenReturn(new StorageConfig().blockstoreType("s3").blockstoreNamespaceValidityRegex("^s3://")); - when(repositoriesApi.getRepository("repo")) - .thenReturn(new Repository().storageNamespace(s3Url("/repo-base"))); - - when(repositoriesApi.getRepository("repo")) - .thenReturn(new Repository().storageNamespace(s3Url("/repo-base"))); - - fs.initializeWithClientFactory(new URI("lakefs://repo/main/file.txt"), conf, () -> lfsClient); - } - - /** - * @return all pathnames under s3Prefix that start with prefix. (Obvious not scalable!) - */ - protected List getS3FilesByPrefix(String prefix) { - final int maxKeys = 1500; - - ListObjectsRequest req = new ListObjectsRequest() - .withBucketName(s3Bucket) - .withPrefix(prefix) - .withMaxKeys(maxKeys); - ObjectListing listing = s3Client.listObjects(req); - if (listing.isTruncated()) { - Assert.fail(String.format("[internal] no support for test that creates >%d S3 objects", maxKeys)); - } - - return Lists.transform(listing.getObjectSummaries(), S3ObjectSummary::getKey); - } - - @Test - public void getUri() { - URI u = fs.getUri(); - Assert.assertNotNull(u); - } - - @Test - public void testGetFileStatus_ExistingFile() throws ApiException, IOException { - Path p = new Path("lakefs://repo/main/exists"); - ObjectStats os = new ObjectStats(); - os.setPath("exists"); - os.checksum(UNUSED_CHECKSUM); - os.setPathType(PathTypeEnum.OBJECT); - os.setMtime(UNUSED_MTIME); - os.setSizeBytes(UNUSED_FILE_SIZE); - os.setPhysicalAddress(s3Url("/repo-base/exists")); - when(objectsApi.statObject("repo", "main", "exists", false, false)) - .thenReturn(os); - LakeFSFileStatus fileStatus = fs.getFileStatus(p); - Assert.assertTrue(fileStatus.isFile()); - Assert.assertEquals(p, fileStatus.getPath()); - } - - @Test - public void testGetFileStatus_NoFile() throws ApiException { - Path noFilePath = new Path("lakefs://repo/main/no.file"); - - when(objectsApi.statObject("repo", "main", "no.file", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", "no.file/", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects("repo", "main", false, false, "", 1, "", "no.file/")) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - Assert.assertThrows(FileNotFoundException.class, () -> fs.getFileStatus(noFilePath)); - } - - @Test - public void testGetFileStatus_DirectoryMarker() throws ApiException, IOException { - Path dirPath = new Path("lakefs://repo/main/dir1/dir2"); - when(objectsApi.statObject("repo", "main", "dir1/dir2", false, false)) - .thenThrow(noSuchFile); - ObjectStats dirObjectStats = new ObjectStats(); - dirObjectStats.setPath("dir1/dir2/"); - dirObjectStats.checksum(UNUSED_CHECKSUM); - dirObjectStats.setPathType(PathTypeEnum.OBJECT); - dirObjectStats.setMtime(UNUSED_MTIME); - dirObjectStats.setSizeBytes(0L); - dirObjectStats.setPhysicalAddress(s3Url("/repo-base/dir12")); - when(objectsApi.statObject("repo", "main", "dir1/dir2/", false, false)) - .thenReturn(dirObjectStats); - LakeFSFileStatus dirStatus = fs.getFileStatus(dirPath); - Assert.assertTrue(dirStatus.isDirectory()); - Assert.assertEquals(dirPath, dirStatus.getPath()); - } - - @Test - public void testExists_ExistsAsObject() throws ApiException, IOException { - Path p = new Path("lakefs://repo/main/exis.ts"); - ObjectStats stats = new ObjectStats().path("exis.ts").pathType(PathTypeEnum.OBJECT); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("exis.ts"))) - .thenReturn(new ObjectStatsList().results(ImmutableList.of(stats))); - Assert.assertTrue(fs.exists(p)); - } - - @Test - public void testExists_ExistsAsDirectoryMarker() throws ApiException, IOException { - Path p = new Path("lakefs://repo/main/exis.ts"); - ObjectStats stats = new ObjectStats().path("exis.ts/").pathType(PathTypeEnum.OBJECT); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("exis.ts"))) - .thenReturn(new ObjectStatsList().results(ImmutableList.of(stats))); - Assert.assertTrue(fs.exists(p)); - } - - @Test - public void testExists_ExistsAsDirectoryContents() throws ApiException, IOException { - Path p = new Path("lakefs://repo/main/exis.ts"); - ObjectStats stats = new ObjectStats().path("exis.ts/inside").pathType(PathTypeEnum.OBJECT); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("exis.ts"))) - .thenReturn(new ObjectStatsList().results(ImmutableList.of(stats))); - Assert.assertTrue(fs.exists(p)); - } - - @Test - public void testExists_ExistsAsDirectoryInSecondList() { - // TODO(ariels) - } - - @Test - public void testExists_NotExistsNoPrefix() throws ApiException, IOException { - Path p = new Path("lakefs://repo/main/doesNotExi.st"); - when(objectsApi.listObjects(any(), any(), any(), any(), any(), any(), any(), any())) - .thenReturn(new ObjectStatsList()); - boolean exists = fs.exists(p); - Assert.assertFalse(exists); - } - - @Test - public void testExists_NotExistsPrefixWithNoSlash() { - // TODO(ariels) - } - - @Test - public void testExists_NotExistsPrefixWithNoSlashTwoLists() { - // TODO(ariels) - } - - @Test - public void testDelete_FileExists() throws ApiException, IOException { - when(objectsApi.statObject("repo", "main", "no/place/file.txt", false, false)) - .thenReturn(new ObjectStats(). - path("delete/sample/file.txt"). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url("/repo-base/delete")). - checksum(UNUSED_CHECKSUM). - mtime(UNUSED_MTIME). - sizeBytes(UNUSED_FILE_SIZE)); - String[] arrDirs = {"no/place", "no"}; - for (String dir: arrDirs) { - when(objectsApi.statObject("repo", "main", dir, false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", dir + Constants.SEPARATOR, false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq(dir + Constants.SEPARATOR))) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - } - StagingLocation stagingLocation = new StagingLocation().token("foo").physicalAddress(s3Url("/repo-base/dir-marker")); - when(stagingApi.getPhysicalAddress("repo", "main", "no/place/", false)) - .thenReturn(stagingLocation); - - Path path = new Path("lakefs://repo/main/no/place/file.txt"); - - mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path.getParent())); - - // return true because file found - boolean success = fs.delete(path, false); - Assert.assertTrue(success); - } - - @Test - public void testDelete_FileNotExists() throws ApiException, IOException { - doThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "not found")) - .when(objectsApi).deleteObject("repo", "main", "no/place/file.txt"); - when(objectsApi.statObject("repo", "main", "no/place/file.txt", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", "no/place/file.txt/", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("no/place/file.txt/"))) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - - // return false because file not found - boolean success = fs.delete(new Path("lakefs://repo/main/no/place/file.txt"), false); - Assert.assertFalse(success); - } - - @Test - public void testDelete_EmptyDirectoryExists() throws ApiException, IOException { - ObjectLocation dirObjLoc = new ObjectLocation("lakefs", "repo", "main", "delete/me"); - String key = objectLocToS3ObjKey(dirObjLoc); - - when(objectsApi.statObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath(), false, false)) - .thenThrow(noSuchFile); - - ObjectStats srcStats = new ObjectStats() - .path(dirObjLoc.getPath() + Constants.SEPARATOR) - .sizeBytes(0L) - .mtime(UNUSED_MTIME) - .pathType(PathTypeEnum.OBJECT) - .physicalAddress(s3Url(key+Constants.SEPARATOR)) - .checksum(UNUSED_CHECKSUM); - when(objectsApi.statObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath() + Constants.SEPARATOR, false, false)) - .thenReturn(srcStats) - .thenThrow(noSuchFile); - - Path path = new Path("lakefs://repo/main/delete/me"); - - mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path.getParent())); - - boolean success = fs.delete(path, false); - Assert.assertTrue(success); - } - - @Test(expected = IOException.class) - public void testDelete_DirectoryWithFile() throws ApiException, IOException { - when(objectsApi.statObject("repo", "main", "delete/sample", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", "delete/sample/", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("delete/sample/"))) - .thenReturn(new ObjectStatsList().results(Collections.singletonList(new ObjectStats(). - path("delete/sample/file.txt"). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url("/repo-base/delete")). - checksum(UNUSED_CHECKSUM). - mtime(UNUSED_MTIME). - sizeBytes(UNUSED_FILE_SIZE))).pagination(new Pagination().hasMore(false))); - doThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "not found")) - .when(objectsApi).deleteObject("repo", "main", "delete/sample/"); - // return false because we can't delete a directory without recursive - fs.delete(new Path("lakefs://repo/main/delete/sample"), false); - } - - @Test - public void testDelete_NotExistsRecursive() throws ApiException, IOException { - when(objectsApi.statObject(eq("repo"), eq("main"), any(), eq(false), eq(false))) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false),eq(false), eq(""), any(), eq(""), eq("no/place/file.txt/"))) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - boolean delete = fs.delete(new Path("lakefs://repo/main/no/place/file.txt"), true); - Assert.assertFalse(delete); - } - - private PathList newPathList(String... paths) { - return new PathList().paths(Arrays.asList(paths)); - } - - @Test - public void testDelete_DirectoryWithFileRecursive() throws ApiException, IOException { - when(objectsApi.statObject("repo", "main", "delete/sample", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", "delete/sample/", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("delete/sample/"))) - .thenReturn(new ObjectStatsList().results(Collections - .singletonList(new ObjectStats(). - path("delete/sample/file.txt"). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url("/repo-base/delete")). - checksum(UNUSED_CHECKSUM). - mtime(UNUSED_MTIME). - sizeBytes(UNUSED_FILE_SIZE))) - .pagination(new Pagination().hasMore(false))); - when(objectsApi.deleteObjects("repo", "main", newPathList("delete/sample/file.txt"))) - .thenReturn(new ObjectErrorList()); - // recursive will always end successfully - Path path = new Path("lakefs://repo/main/delete/sample"); - - mockDirectoryMarker(ObjectLocation.pathToObjectLocation(null, path.getParent())); - - boolean delete = fs.delete(path, true); - Assert.assertTrue(delete); - } - - protected void caseDeleteDirectoryRecursive(int bulkSize, int numObjects) throws ApiException, IOException { - conf.setInt(LakeFSFileSystem.LAKEFS_DELETE_BULK_SIZE, bulkSize); - when(objectsApi.statObject("repo", "main", "delete/sample", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", "delete/sample/", false, false)) - .thenThrow(noSuchFile); - - List objects = new ArrayList(); - for (int i = 0; i < numObjects; i++) { - objects.add(new ObjectStats(). - path(String.format("delete/sample/file%04d.txt", i)). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url(String.format("/repo-base/delete%04d", i))). - checksum(UNUSED_CHECKSUM). - mtime(UNUSED_MTIME). - sizeBytes(UNUSED_FILE_SIZE)); - } - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq("delete/sample/"))) - .thenReturn(new ObjectStatsList() - .results(objects) - .pagination(new Pagination().hasMore(false))); - - // Set up multiple deleteObjects expectations of bulkSize deletes - // each (except for the last, which might be smaller). - for (int start = 0; start < numObjects; start += bulkSize) { - PathList pl = new PathList(); - for (int i = start; i < numObjects && i < start + bulkSize; i++) { - pl.addPathsItem(String.format("delete/sample/file%04d.txt", i)); - } - when(objectsApi.deleteObjects(eq("repo"), eq("main"), eq(pl))) - .thenReturn(new ObjectErrorList()); - } - // Mock parent directory marker creation at end of fs.delete to show - // the directory marker exists. - ObjectLocation dir = new ObjectLocation("lakefs", "repo", "main", "delete"); - mockDirectoryMarker(dir); - // recursive will always end successfully - boolean delete = fs.delete(new Path("lakefs://repo/main/delete/sample"), true); - Assert.assertTrue(delete); - } - - @Test - public void testDeleteDirectoryRecursiveBatch1() throws ApiException, IOException { - caseDeleteDirectoryRecursive(1, 123); - } - - @Test - public void testDeleteDirectoryRecursiveBatch2() throws ApiException, IOException { - caseDeleteDirectoryRecursive(2, 123); - } - - @Test - public void testDeleteDirectoryRecursiveBatch3() throws ApiException, IOException { - caseDeleteDirectoryRecursive(3, 123); - } - @Test - public void testDeleteDirectoryRecursiveBatch5() throws ApiException, IOException { - caseDeleteDirectoryRecursive(5, 123); - } - @Test - public void testDeleteDirectoryRecursiveBatch120() throws ApiException, IOException { - caseDeleteDirectoryRecursive(120, 123); - } - @Test - public void testDeleteDirectoryRecursiveBatch123() throws ApiException, IOException { - caseDeleteDirectoryRecursive(123, 123); - } - - @Test - public void testCreate() throws ApiException, IOException { - String contents = "The quick brown fox jumps over the lazy dog."; - Path p = new Path("lakefs://repo/main/sub1/sub2/create.me"); - - mockNonExistingPath(new ObjectLocation("lakefs", "repo", "main", "sub1/sub2/create.me")); - - StagingLocation stagingLocation = mockGetPhysicalAddress("repo", "main", "sub1/sub2/create.me", "repo-base/create"); - - // mock sub1/sub2 was an empty directory - ObjectLocation sub2Loc = new ObjectLocation("lakefs", "repo", "main", "sub1/sub2"); - mockEmptyDirectoryMarker(sub2Loc); - - OutputStream out = fs.create(p); - out.write(contents.getBytes()); - out.close(); - - ArgumentCaptor metadataCapture = ArgumentCaptor.forClass(StagingMetadata.class); - verify(stagingApi).linkPhysicalAddress(eq("repo"), eq("main"), eq("sub1/sub2/create.me"), - metadataCapture.capture()); - StagingMetadata actualMetadata = metadataCapture.getValue(); - Assert.assertEquals(stagingLocation, actualMetadata.getStaging()); - Assert.assertEquals(contents.getBytes().length, actualMetadata.getSizeBytes().longValue()); - - // Write succeeded, verify physical file on S3. - S3Object ret = s3Client.getObject(new GetObjectRequest(s3Bucket, "/repo-base/create")); - InputStream in = ret.getObjectContent(); - String actual = IOUtils.toString(in); - - Assert.assertEquals(contents, actual); - - List actualFiles = getS3FilesByPrefix("/"); - Assert.assertEquals(ImmutableList.of("repo-base/create"), actualFiles); - - // expected to delete the empty dir marker - verifyObjDeletion(new ObjectLocation("lakefs", "repo", "main", "sub1/sub2/")); - } - - @Test(expected = FileAlreadyExistsException.class) - public void testCreateExistingDirectory() throws ApiException, IOException { - ObjectLocation dir = new ObjectLocation("lakefs", "repo", "main", "sub1/sub2/create.me"); - mockExistingDirPath(dir, Collections.emptyList()); - fs.create(new Path("lakefs://repo/main/sub1/sub2/create.me"), false); - } - - @Test(expected = FileAlreadyExistsException.class) - public void testCreateExistingFile() throws ApiException, IOException { - ObjectLocation dir = new ObjectLocation("lakefs", "repo", "main", "sub1/sub2"); - mockExistingDirPath(dir, ImmutableList.of(new ObjectLocation("lakefs", "repo", "main", "sub1/sub2/create.me"))); - fs.create(new Path("lakefs://repo/main/sub1/sub2/create.me"), false); - } - - @Test - public void testMkdirs() throws ApiException, IOException { - // setup empty folder checks - Path testPath = new Path("dir1/dir2/dir3"); - do { - when(objectsApi.statObject("repo", "main", testPath.toString(), false, false)) - .thenThrow(noSuchFile); - when(objectsApi.statObject("repo", "main", testPath+"/", false, false)) - .thenThrow(noSuchFile); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), any(), eq(""), eq(testPath+"/"))) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - testPath = testPath.getParent(); - } while(testPath != null && !testPath.isRoot()); - - // physical address to directory marker object - StagingLocation stagingLocation = mockGetPhysicalAddress("repo", "main", "dir1/dir2/dir3/", "repo-base/emptyDir"); - - // call mkdirs - Path p = new Path("lakefs://repo/main/dir1/dir2/dir3"); - boolean mkdirs = fs.mkdirs(p); - Assert.assertTrue("make dirs", mkdirs); - - // verify metadata - ArgumentCaptor metadataCapture = ArgumentCaptor.forClass(StagingMetadata.class); - verify(stagingApi).linkPhysicalAddress(eq("repo"), eq("main"), eq("dir1/dir2/dir3/"), - metadataCapture.capture()); - StagingMetadata actualMetadata = metadataCapture.getValue(); - Assert.assertEquals(stagingLocation, actualMetadata.getStaging()); - Assert.assertEquals(0, (long)actualMetadata.getSizeBytes()); - - // verify file exists on s3 - S3Object ret = s3Client.getObject(new GetObjectRequest(s3Bucket, "/repo-base/emptyDir")); - String actual = IOUtils.toString(ret.getObjectContent()); - Assert.assertEquals("", actual); - } - - @Test - public void testOpen() throws IOException, ApiException { - String contents = "The quick brown fox jumps over the lazy dog."; - byte[] contentsBytes = contents.getBytes(); - String physicalKey = "/repo-base/open"; - int readBufferSize = 5; - - // Write physical file to S3. - ObjectMetadata s3Metadata = new ObjectMetadata(); - s3Metadata.setContentLength(contentsBytes.length); - s3Client.putObject(new PutObjectRequest(s3Bucket, physicalKey, new ByteArrayInputStream(contentsBytes), s3Metadata)); - - Path p = new Path("lakefs://repo/main/read.me"); - mockStatObject("repo", "main", "read.me", physicalKey, (long)contentsBytes.length); - try (InputStream in = fs.open(p, readBufferSize)) { - String actual = IOUtils.toString(in); - Assert.assertEquals(contents, actual); - } - } - - @Test - public void testOpenWithInvalidUriChars() throws IOException, ApiException { - String contents = "The quick brown fox jumps over the lazy dog."; - byte[] contentsBytes = contents.getBytes(); - int readBufferSize = 5; - - String[] keys = { - "/repo-base/with space/open", - "/repo-base/wi:th$cha&rs#/%op;e?n", - "/repo-base/עכשיו/בעברית/open", - "/repo-base/\uD83E\uDD2F/imoji/open", - }; - for (String key : keys) { - // Write physical file to S3. - ObjectMetadata s3Metadata = new ObjectMetadata(); - s3Metadata.setContentLength(contentsBytes.length); - s3Client.putObject(new PutObjectRequest(s3Bucket, key, new ByteArrayInputStream(contentsBytes), s3Metadata)); - - Path p = new Path("lakefs://repo/main/read.me"); - mockStatObject("repo", "main", "read.me", key, (long) contentsBytes.length); - try (InputStream in = fs.open(p, readBufferSize)) { - String actual = IOUtils.toString(in); - Assert.assertEquals(contents, actual); - } - } - } - - @Test(expected = FileNotFoundException.class) - public void testOpen_NotExists() throws IOException, ApiException { - Path p = new Path("lakefs://repo/main/doesNotExi.st"); - when(objectsApi.statObject(any(), any(), any(), any(), any())) - .thenThrow(noSuchFile); - fs.open(p); - } - - /* - @Test - public void listFiles() throws IOException, URISyntaxException { - RemoteIterator it = fs.listFiles(new Path("lakefs://example1/master"), true); - List l = new ArrayList<>(); - while (it.hasNext()) { - l.add(it.next()); - } - // expected 'l' to include all the files in branch - no directory will be listed, with or without recursive - - Configuration conf = new Configuration(false); - conf.set(org.apache.hadoop.fs.s3a.Constants.ACCESS_KEY, ""); - conf.set(org.apache.hadoop.fs.s3a.Constants.SECRET_KEY, ""); - conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem"); - FileSystem fs2 = FileSystem.get(new URI("s3a://bucket/"), conf); - RemoteIterator it2 = fs2.listFiles(new Path("s3a://bucket"), true); - List l2 = new ArrayList<>(); - while (it2.hasNext()) { - l2.add(it2.next()); - } - // expected 'l2' to include all the files in bucket - no directory will be listed, with or without recursive - } - */ - - @Test - public void testListStatusFile() throws ApiException, IOException { - ObjectStats objectStats = new ObjectStats(). - path("status/file"). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url("/repo-base/status")). - checksum(STATUS_CHECKSUM). - mtime(STATUS_MTIME). - sizeBytes(STATUS_FILE_SIZE); - when(objectsApi.statObject("repo", "main", "status/file", false, false)) - .thenReturn(objectStats); - Path p = new Path("lakefs://repo/main/status/file"); - FileStatus[] fileStatuses = fs.listStatus(p); - LakeFSFileStatus expectedFileStatus = new LakeFSFileStatus.Builder(p) - .length(STATUS_FILE_SIZE) - .checksum(STATUS_CHECKSUM) - .mTime(STATUS_MTIME) - .physicalAddress(p.toString()) - .blockSize(Constants.DEFAULT_BLOCK_SIZE) - .build(); - LakeFSFileStatus[] expectedFileStatuses = new LakeFSFileStatus[]{expectedFileStatus}; - Assert.assertArrayEquals(expectedFileStatuses, fileStatuses); - } - - @Test(expected = FileNotFoundException.class) - public void testListStatusNotFound() throws ApiException, IOException { - when(objectsApi.statObject("repo", "main", "status/file", false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - when(objectsApi.statObject("repo", "main", "status/file/", false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), - any(), eq("/"), eq("status/file/"))) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - Path p = new Path("lakefs://repo/main/status/file"); - fs.listStatus(p); - } - - @Test - public void testListStatusDirectory() throws ApiException, IOException { - int totalObjectsCount = 3; - ObjectStatsList objects = new ObjectStatsList(); - for (int i = 0; i < totalObjectsCount; i++) { - ObjectStats objectStats = new ObjectStats(). - path("status/file" + i). - pathType(PathTypeEnum.OBJECT). - physicalAddress(s3Url("/repo-base/status" + i)). - checksum(STATUS_CHECKSUM). - mtime(STATUS_MTIME). - sizeBytes(STATUS_FILE_SIZE); - objects.addResultsItem(objectStats); - } - when(objectsApi.listObjects(eq("repo"), eq("main"), eq(false), eq(false), eq(""), - any(), eq("/"), eq("status/"))) - .thenReturn(objects.pagination(new Pagination().hasMore(false))); - when(objectsApi.statObject("repo", "main", "status", false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - - Path dir = new Path("lakefs://repo/main/status"); - FileStatus[] fileStatuses = fs.listStatus(dir); - FileStatus[] expectedFileStatuses = new LocatedFileStatus[totalObjectsCount]; - for (int i = 0; i < totalObjectsCount; i++) { - Path p = new Path(dir + "/file" + i); - LakeFSFileStatus fileStatus = new LakeFSFileStatus.Builder(p) - .length(STATUS_FILE_SIZE) - .checksum(STATUS_CHECKSUM) - .mTime(STATUS_MTIME) - .blockSize(Constants.DEFAULT_BLOCK_SIZE) - .physicalAddress(s3Url("/repo-base/status" + i)) - .build(); - expectedFileStatuses[i] = new LocatedFileStatus(fileStatus, null); - } - Assert.assertArrayEquals(expectedFileStatuses, fileStatuses); - } - - @Test(expected = UnsupportedOperationException.class) - public void testAppend() throws IOException { - fs.append(null, 0, null); - } - - private void mockDirectoryMarker(ObjectLocation objectLoc) throws ApiException { - // Mock parent directory to show the directory marker exists. - ObjectStats markerStats = new ObjectStats().path(objectLoc.getPath()).pathType(PathTypeEnum.OBJECT); - when(objectsApi.listObjects(eq(objectLoc.getRepository()), eq(objectLoc.getRef()), eq(false), eq(false), eq(""), any(), eq(""), eq(objectLoc.getPath()))). - thenReturn(new ObjectStatsList().results(ImmutableList.of(markerStats))); - } - - private void mockNonExistingPath(ObjectLocation objectLoc) throws ApiException { - when(objectsApi.statObject(objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath(), false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - - when(objectsApi.statObject(objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath() + Constants.SEPARATOR, false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - - when(objectsApi.listObjects(eq(objectLoc.getRepository()), eq(objectLoc.getRef()), eq(false), eq(false), - eq(""), any(), eq(""), eq(objectLoc.getPath() + Constants.SEPARATOR))) - .thenReturn(new ObjectStatsList().pagination(new Pagination().hasMore(false))); - } - - private void mockExistingDirPath(ObjectLocation dirObjLoc, List filesInDir) throws ApiException { - // io.lakefs.LakeFSFileSystem.getFileStatus tries to get object stats, when it can't find an object if will - // fall back to try listing items under this path to discover the objects it contains. if objects are found, - // then the path considered a directory. - - ObjectStatsList stats = new ObjectStatsList(); - - // Mock directory marker - if (filesInDir.isEmpty()) { - ObjectStats markerStat = mockEmptyDirectoryMarker(dirObjLoc); - stats.addResultsItem(markerStat); - } else { - when(objectsApi.statObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath(), false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - when(objectsApi.statObject(dirObjLoc.getRepository(), dirObjLoc.getRef(), dirObjLoc.getPath() + Constants.SEPARATOR, false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - } - - // Mock the files under this directory - for (ObjectLocation loc : filesInDir) { - ObjectStats fileStat = mockExistingFilePath(loc); - stats.addResultsItem(fileStat); - } - - - // Mock listing the files under this directory - stats.setPagination(new Pagination().hasMore(false)); - when(objectsApi.listObjects(eq(dirObjLoc.getRepository()), eq(dirObjLoc.getRef()), eq(false), eq(false), - eq(""), any(), eq(""), eq(dirObjLoc.getPath() + Constants.SEPARATOR))) - .thenReturn(stats); - } - - private ObjectStats mockExistingFilePath(ObjectLocation objectLoc) throws ApiException { - String key = objectLocToS3ObjKey(objectLoc); - ObjectStats srcStats = new ObjectStats() - .path(objectLoc.getPath()) - .sizeBytes(UNUSED_FILE_SIZE) - .mtime(UNUSED_MTIME) - .pathType(PathTypeEnum.OBJECT) - .physicalAddress(s3Url(key)) - .checksum(UNUSED_CHECKSUM); - when(objectsApi.statObject(objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath(), false, false)).thenReturn(srcStats); - return srcStats; - } - - private void mockMissingCopyAPI() throws ApiException { - when(objectsApi.copyObject(any(), any(), any(), any())).thenThrow(new ApiException(HttpStatus.SC_INTERNAL_SERVER_ERROR, null, "{\"message\":\"invalid API endpoint\"}")); - when(objectsApi.stageObject(any(), any(), any(), any())).thenReturn(new ObjectStats()); - } - - private ObjectStats mockEmptyDirectoryMarker(ObjectLocation objectLoc) throws ApiException { - String key = objectLocToS3ObjKey(objectLoc); - - when(objectsApi.statObject(objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath(), false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - - ObjectStats srcStats = new ObjectStats() - .path(objectLoc.getPath() + Constants.SEPARATOR) - .sizeBytes(0L) - .mtime(UNUSED_MTIME) - .pathType(PathTypeEnum.OBJECT) - .physicalAddress(s3Url(key+Constants.SEPARATOR)) - .checksum(UNUSED_CHECKSUM); - when(objectsApi.statObject(objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath() + Constants.SEPARATOR, false, false)) - .thenReturn(srcStats); - - ObjectLocation parentLoc = objectLoc.getParent(); - while (parentLoc != null && parentLoc.isValidPath()) { - when(objectsApi.statObject(parentLoc.getRepository(), parentLoc.getRef(), parentLoc.getPath(), false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - when(objectsApi.statObject(parentLoc.getRepository(), parentLoc.getRef(), parentLoc.getPath()+ Constants.SEPARATOR, false, false)) - .thenThrow(new ApiException(HttpStatus.SC_NOT_FOUND, "no such file")); - when(objectsApi.listObjects(parentLoc.getRepository(), parentLoc.getRef(), false, false, "", 1, "", parentLoc.getPath() + Constants.SEPARATOR)) - .thenReturn(new ObjectStatsList().results(Collections.emptyList()).pagination(new Pagination().hasMore(false))); - parentLoc = parentLoc.getParent(); - } - return srcStats; - } - - private String objectLocToS3ObjKey(ObjectLocation objectLoc) { - return String.format("/%s/%s/%s",objectLoc.getRepository(), objectLoc.getRef(), objectLoc.getPath()); - } - - private void verifyObjDeletion(ObjectLocation srcObjLoc) throws ApiException { - verify(objectsApi).deleteObject(srcObjLoc.getRepository(), srcObjLoc.getRef(), srcObjLoc.getPath()); - } - - private boolean dstPathLinkedToSrcPhysicalAddress(ObjectLocation srcObjLoc, ObjectLocation dstObjLoc) throws ApiException { - ArgumentCaptor creationReqCapture = ArgumentCaptor.forClass(ObjectCopyCreation.class); - verify(objectsApi).copyObject(eq(dstObjLoc.getRepository()), eq(dstObjLoc.getRef()), eq(dstObjLoc.getPath()), - creationReqCapture.capture()); - ObjectCopyCreation actualCreationReq = creationReqCapture.getValue(); - // Rename is a metadata operation, therefore the dst name is expected to link to the src physical address. - return srcObjLoc.getRef().equals(actualCreationReq.getSrcRef()) && - srcObjLoc.getPath().equals(actualCreationReq.getSrcPath()); - } - - /** - * rename(src.txt, non-existing-dst) -> non-existing/new - unsupported, should fail with false - */ - @Test - public void testRename_existingFileToNonExistingDst() throws IOException, ApiException { - Path src = new Path("lakefs://repo/main/existing.src"); - ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); - mockExistingFilePath(srcObjLoc); - - Path dst = new Path("lakefs://repo/main/non-existing/new"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - mockNonExistingPath(dstObjLoc); - mockNonExistingPath(fs.pathToObjectLocation(dst.getParent())); - - mockDirectoryMarker(fs.pathToObjectLocation(src.getParent())); - - boolean renamed = fs.rename(src, dst); - Assert.assertFalse(renamed); - } - - @Test - public void testRename_existingFileToExistingFileName() throws ApiException, IOException { - Path src = new Path("lakefs://repo/main/existing.src"); - ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); - mockExistingFilePath(srcObjLoc); - - Path dst = new Path("lakefs://repo/main/existing.dst"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - mockExistingFilePath(dstObjLoc); - - mockDirectoryMarker(fs.pathToObjectLocation(src.getParent())); - - boolean success = fs.rename(src, dst); - Assert.assertTrue(success); - } - - @Test - public void testRename_existingDirToExistingFileName() throws ApiException, IOException { - Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); - ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInSrcDir); - Path srcDir = new Path("lakefs://repo/main/existing-dir"); - ObjectLocation srcDirObjLoc = fs.pathToObjectLocation(srcDir); - mockExistingDirPath(srcDirObjLoc, ImmutableList.of(fileObjLoc)); - - Path dst = new Path("lakefs://repo/main/existingdst.file"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - mockExistingFilePath(dstObjLoc); - - boolean success = fs.rename(srcDir, dst); - Assert.assertFalse(success); - } - - /** - * file -> existing-directory-name: rename(src.txt, existing-dstdir) -> existing-dstdir/src.txt - */ - @Test - public void testRename_existingFileToExistingDirName() throws ApiException, IOException { - Path src = new Path("lakefs://repo/main/existing-dir1/existing.src"); - ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); - mockExistingFilePath(srcObjLoc); - - Path fileInDstDir = new Path("lakefs://repo/main/existing-dir2/existing.src"); - ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInDstDir); - Path dst = new Path("lakefs://repo/main/existing-dir2"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - mockExistingDirPath(dstObjLoc, ImmutableList.of(fileObjLoc)); - - mockDirectoryMarker(fs.pathToObjectLocation(src.getParent())); - - boolean renamed = fs.rename(src, dst); - Assert.assertTrue(renamed); - Path expectedDstPath = new Path("lakefs://repo/main/existing-dir2/existing.src"); - Assert.assertTrue(dstPathLinkedToSrcPhysicalAddress(srcObjLoc, fs.pathToObjectLocation(expectedDstPath))); - verifyObjDeletion(srcObjLoc); - } - - /** - * rename(srcDir(containing srcDir/a.txt, srcDir/b.txt), non-existing-dir/new) -> unsupported, rename should fail by returning false - */ - @Test - public void testRename_existingDirToNonExistingDirWithoutParent() throws ApiException, IOException { - Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); - ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInSrcDir); - Path srcDir = new Path("lakefs://repo/main/existing-dir"); - ObjectLocation srcDirObjLoc = fs.pathToObjectLocation(srcDir); - mockExistingDirPath(srcDirObjLoc, ImmutableList.of(fileObjLoc)); - mockNonExistingPath(new ObjectLocation("lakefs", "repo", "main", "non-existing-dir")); - mockNonExistingPath(new ObjectLocation("lakefs", "repo", "main", "non-existing-dir/new")); - - Path dst = new Path("lakefs://repo/main/non-existing-dir/new"); - boolean renamed = fs.rename(srcDir, dst); - Assert.assertFalse(renamed); - } - - /** - * rename(srcDir(containing srcDir/a.txt, srcDir/b.txt), non-existing-dir/new) -> unsupported, rename should fail by returning false - */ - @Test - public void testRename_existingDirToNonExistingDirWithParent() throws ApiException, IOException { - Path fileInSrcDir = new Path("lakefs://repo/main/existing-dir/existing.src"); - ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInSrcDir); - Path srcDir = new Path("lakefs://repo/main/existing-dir"); - ObjectLocation srcDirObjLoc = fs.pathToObjectLocation(srcDir); - mockExistingDirPath(srcDirObjLoc, ImmutableList.of(fileObjLoc)); - mockExistingDirPath(new ObjectLocation("lakefs", "repo", "main", "existing-dir2/new"), Collections.emptyList()); - - Path dst = new Path("lakefs://repo/main/existing-dir2/new"); - mockDirectoryMarker(fs.pathToObjectLocation(srcDir)); - - boolean renamed = fs.rename(srcDir, dst); - Assert.assertTrue(renamed); - } - - /** - * rename(srcDir(containing srcDir/a.txt), existing-nonempty-dstdir) -> unsupported, rename should fail by returning false. - */ - @Test - public void testRename_existingDirToExistingNonEmptyDirName() throws ApiException, IOException { - Path firstSrcFile = new Path("lakefs://repo/main/existing-dir1/a.src"); - ObjectLocation firstObjLoc = fs.pathToObjectLocation(firstSrcFile); - Path secSrcFile = new Path("lakefs://repo/main/existing-dir1/b.src"); - ObjectLocation secObjLoc = fs.pathToObjectLocation(secSrcFile); - - Path srcDir = new Path("lakefs://repo/main/existing-dir1"); - ObjectLocation srcDirObjLoc = fs.pathToObjectLocation(srcDir); - mockExistingDirPath(srcDirObjLoc, ImmutableList.of(firstObjLoc, secObjLoc)); - - Path fileInDstDir = new Path("lakefs://repo/main/existing-dir2/file.dst"); - ObjectLocation dstFileObjLoc = fs.pathToObjectLocation(fileInDstDir); - Path dstDir = new Path("lakefs://repo/main/existing-dir2"); - ObjectLocation dstDirObjLoc = fs.pathToObjectLocation(dstDir); - mockExistingDirPath(dstDirObjLoc, ImmutableList.of(dstFileObjLoc)); - - boolean renamed = fs.rename(srcDir, dstDir); - Assert.assertFalse(renamed); - } - - /** - * Check that a file is renamed when working against a lakeFS version - * where CopyObject API doesn't exist - */ - @Test - public void testRename_fallbackStageAPI() throws ApiException, IOException { - Path src = new Path("lakefs://repo/main/existing-dir1/existing.src"); - ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); - mockExistingFilePath(srcObjLoc); - - Path fileInDstDir = new Path("lakefs://repo/main/existing-dir2/existing.src"); - ObjectLocation fileObjLoc = fs.pathToObjectLocation(fileInDstDir); - Path dst = new Path("lakefs://repo/main/existing-dir2"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - - mockExistingDirPath(dstObjLoc, ImmutableList.of(fileObjLoc)); - mockDirectoryMarker(fs.pathToObjectLocation(src.getParent())); - mockMissingCopyAPI(); - - boolean renamed = fs.rename(src, dst); - Assert.assertTrue(renamed); - Path expectedDstPath = new Path("lakefs://repo/main/existing-dir2/existing.src"); - Assert.assertTrue(dstPathLinkedToSrcPhysicalAddress(srcObjLoc, fs.pathToObjectLocation(expectedDstPath))); - verifyObjDeletion(srcObjLoc); - } - - @Test - public void testRename_srcAndDstOnDifferentBranch() throws IOException, ApiException { - Path src = new Path("lakefs://repo/branch/existing.src"); - Path dst = new Path("lakefs://repo/another-branch/existing.dst"); - boolean renamed = fs.rename(src, dst); - Assert.assertFalse(renamed); - Mockito.verify(objectsApi, never()).statObject(any(), any(), any(), any(), any()); - Mockito.verify(objectsApi, never()).copyObject(any(), any(), any(), any()); - Mockito.verify(objectsApi, never()).deleteObject(any(), any(), any()); - } - - /** - * no-op. rename is expected to succeed. - */ - @Test - public void testRename_srcEqualsDst() throws IOException, ApiException { - Path src = new Path("lakefs://repo/main/existing.src"); - Path dst = new Path("lakefs://repo/main/existing.src"); - boolean renamed = fs.rename(src, dst); - Assert.assertTrue(renamed); - Mockito.verify(objectsApi, never()).statObject(any(), any(), any(), any(), any()); - Mockito.verify(objectsApi, never()).copyObject(any(), any(), any(), any()); - Mockito.verify(objectsApi, never()).deleteObject(any(), any(), any()); - } - - @Test - public void testRename_nonExistingSrcFile() throws ApiException, IOException { - Path src = new Path("lakefs://repo/main/non-existing.src"); - ObjectLocation srcObjLoc = fs.pathToObjectLocation(src); - mockNonExistingPath(srcObjLoc); - - Path dst = new Path("lakefs://repo/main/existing.dst"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(dst); - mockExistingFilePath(dstObjLoc); - - boolean success = fs.rename(src, dst); - Assert.assertFalse(success); - } - - /** - * globStatus is used only by the Hadoop CLI where the pattern is always the exact file. - */ - @Test - public void testGlobStatus_SingleFile() throws ApiException, IOException { - Path path = new Path("lakefs://repo/main/existing.dst"); - ObjectLocation dstObjLoc = fs.pathToObjectLocation(path); - mockExistingFilePath(dstObjLoc); - - FileStatus[] statuses = fs.globStatus(path); - Assert.assertArrayEquals(new FileStatus[]{ - new LakeFSFileStatus.Builder(path).build() - }, statuses); - } -} diff --git a/clients/hadoopfs/src/test/java/io/lakefs/S3FSTestBase.java b/clients/hadoopfs/src/test/java/io/lakefs/S3FSTestBase.java new file mode 100644 index 00000000000..d2112b71051 --- /dev/null +++ b/clients/hadoopfs/src/test/java/io/lakefs/S3FSTestBase.java @@ -0,0 +1,128 @@ +package io.lakefs; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.amazonaws.ClientConfiguration; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.S3ClientOptions; +import com.amazonaws.services.s3.model.*; +import com.aventrix.jnanoid.jnanoid.NanoIdUtils; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.apache.commons.io.IOUtils; + +import io.lakefs.clients.api.model.*; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.utility.DockerImageName; + +import java.util.List; + +/** + * Base for all LakeFSFilesystem tests that need to access S3. It adds a + * MinIO container to FSTestBase, and configures to use it. + */ +abstract class S3FSTestBase extends FSTestBase { + static private final Logger LOG = LoggerFactory.getLogger(S3FSTestBase.class); + + protected String s3Endpoint; + protected AmazonS3 s3Client; + + private static final DockerImageName MINIO = DockerImageName.parse("minio/minio:RELEASE.2021-06-07T21-40-51Z"); + + @Rule + public final GenericContainer s3 = new GenericContainer(MINIO.toString()). + withCommand("minio", "server", "/data"). + withEnv("MINIO_ROOT_USER", S3_ACCESS_KEY_ID). + withEnv("MINIO_ROOT_PASSWORD", S3_SECRET_ACCESS_KEY). + withEnv("MINIO_DOMAIN", "s3.local.lakefs.io"). + withEnv("MINIO_UPDATE", "off"). + withExposedPorts(9000); + + @Before + public void logS3Container() { + Logger s3Logger = LoggerFactory.getLogger("s3 container"); + Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(s3Logger) + .withMdc("container", "s3") + .withSeparateOutputStreams(); + s3.followOutput(logConsumer); + } + + public void s3ClientSetup() { + AWSCredentials creds = new BasicAWSCredentials(S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY); + + ClientConfiguration clientConfiguration = new ClientConfiguration() + .withSignerOverride("AWSS3V4SignerType"); + s3Endpoint = String.format("http://s3.local.lakefs.io:%d", s3.getMappedPort(9000)); + + s3Client = new AmazonS3Client(creds, clientConfiguration); + + S3ClientOptions s3ClientOptions = new S3ClientOptions() + .withPathStyleAccess(true); + s3Client.setS3ClientOptions(s3ClientOptions); + s3Client.setEndpoint(s3Endpoint); + + s3Bucket = makeS3BucketName(); + s3Base = String.format("s3://%s/", s3Bucket); + LOG.info("S3: bucket {} => base URL {}", s3Bucket, s3Base); + + CreateBucketRequest cbr = new CreateBucketRequest(s3Bucket); + s3Client.createBucket(cbr); + } + + /** + * @return all pathnames under s3Prefix that start with prefix. (Obvious not scalable!) + */ + protected List getS3FilesByPrefix(String prefix) { + + ListObjectsRequest req = new ListObjectsRequest() + .withBucketName(s3Bucket) + .withPrefix(prefix) + .withDelimiter(null); + + ObjectListing listing = s3Client.listObjects(req); + List summaries = listing.getObjectSummaries(); + if (listing.isTruncated()) { + Assert.fail(String.format("[internal] no support for test that creates >%d S3 objects", listing.getMaxKeys())); + } + + return Lists.transform(summaries, S3ObjectSummary::getKey); + } + + protected void assertS3Object(StagingLocation stagingLocation, String contents) { + String s3Key = getS3Key(stagingLocation); + List actualFiles = ImmutableList.of(""); + try (S3Object obj = + s3Client.getObject(new GetObjectRequest(s3Bucket, "/" + s3Key))) { + actualFiles = getS3FilesByPrefix(""); + String actual = IOUtils.toString(obj.getObjectContent()); + Assert.assertEquals(contents, actual); + + Assert.assertEquals(ImmutableList.of(s3Key), actualFiles); + } catch (Exception e) { + throw new RuntimeException("Files " + actualFiles + + "; read key " + s3Key + " failed", e); + } + } + + protected void moreHadoopSetup() { + s3ClientSetup(); + + conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem"); + conf.set(org.apache.hadoop.fs.s3a.Constants.ACCESS_KEY, S3_ACCESS_KEY_ID); + conf.set(org.apache.hadoop.fs.s3a.Constants.SECRET_KEY, S3_SECRET_ACCESS_KEY); + conf.set(org.apache.hadoop.fs.s3a.Constants.ENDPOINT, s3Endpoint); + conf.set(org.apache.hadoop.fs.s3a.Constants.BUFFER_DIR, "/tmp/s3a"); + } +} diff --git a/clients/hadoopfs/src/test/resources/log4j.properties b/clients/hadoopfs/src/test/resources/log4j.properties index f8d5a195017..912e56b6a40 100644 --- a/clients/hadoopfs/src/test/resources/log4j.properties +++ b/clients/hadoopfs/src/test/resources/log4j.properties @@ -4,5 +4,8 @@ log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n -log4j.logger.io.lakefs=DEBUG, A1 +log4j.logger.io.lakefs=DEBUG +# Comment this out to show mockserver INFO logs. They will help you debug +# MockServer expectations and results. +log4j.logger.org.mockserver.log=WARN \ No newline at end of file diff --git a/clients/java-legacy/.gitignore b/clients/java-legacy/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/clients/java-legacy/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/clients/java-legacy/.openapi-generator-ignore b/clients/java-legacy/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/clients/java-legacy/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/clients/java-legacy/.openapi-generator/FILES b/clients/java-legacy/.openapi-generator/FILES new file mode 100644 index 00000000000..17d3b3c44d2 --- /dev/null +++ b/clients/java-legacy/.openapi-generator/FILES @@ -0,0 +1,333 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/ACL.md +docs/AccessKeyCredentials.md +docs/ActionRun.md +docs/ActionRunList.md +docs/ActionsApi.md +docs/AuthApi.md +docs/AuthCapabilities.md +docs/AuthenticationToken.md +docs/BranchCreation.md +docs/BranchProtectionRule.md +docs/BranchesApi.md +docs/CherryPickCreation.md +docs/CommPrefsInput.md +docs/Commit.md +docs/CommitCreation.md +docs/CommitList.md +docs/CommitsApi.md +docs/ConfigApi.md +docs/Credentials.md +docs/CredentialsList.md +docs/CredentialsWithSecret.md +docs/CurrentUser.md +docs/Diff.md +docs/DiffList.md +docs/DiffProperties.md +docs/Error.md +docs/ErrorNoACL.md +docs/ExperimentalApi.md +docs/FindMergeBaseResult.md +docs/GarbageCollectionConfig.md +docs/GarbageCollectionPrepareResponse.md +docs/GarbageCollectionRule.md +docs/GarbageCollectionRules.md +docs/Group.md +docs/GroupCreation.md +docs/GroupList.md +docs/HealthCheckApi.md +docs/HookRun.md +docs/HookRunList.md +docs/ImportApi.md +docs/ImportCreation.md +docs/ImportCreationResponse.md +docs/ImportLocation.md +docs/ImportStatus.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InternalApi.md +docs/LoginConfig.md +docs/LoginInformation.md +docs/Merge.md +docs/MergeResult.md +docs/MetaRangeCreation.md +docs/MetaRangeCreationResponse.md +docs/MetadataApi.md +docs/OTFDiffs.md +docs/ObjectCopyCreation.md +docs/ObjectError.md +docs/ObjectErrorList.md +docs/ObjectStageCreation.md +docs/ObjectStats.md +docs/ObjectStatsList.md +docs/ObjectsApi.md +docs/OtfDiffEntry.md +docs/OtfDiffList.md +docs/Pagination.md +docs/PathList.md +docs/Policy.md +docs/PolicyList.md +docs/PrepareGCUncommittedRequest.md +docs/PrepareGCUncommittedResponse.md +docs/RangeMetadata.md +docs/Ref.md +docs/RefList.md +docs/RefsApi.md +docs/RefsDump.md +docs/RepositoriesApi.md +docs/Repository.md +docs/RepositoryCreation.md +docs/RepositoryList.md +docs/ResetCreation.md +docs/RetentionApi.md +docs/RevertCreation.md +docs/Setup.md +docs/SetupState.md +docs/StagingApi.md +docs/StagingLocation.md +docs/StagingMetadata.md +docs/Statement.md +docs/StatsEvent.md +docs/StatsEventsList.md +docs/StorageConfig.md +docs/StorageURI.md +docs/TagCreation.md +docs/TagsApi.md +docs/UnderlyingObjectProperties.md +docs/UpdateToken.md +docs/User.md +docs/UserCreation.md +docs/UserList.md +docs/VersionConfig.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/io/lakefs/clients/api/ActionsApi.java +src/main/java/io/lakefs/clients/api/ApiCallback.java +src/main/java/io/lakefs/clients/api/ApiClient.java +src/main/java/io/lakefs/clients/api/ApiException.java +src/main/java/io/lakefs/clients/api/ApiResponse.java +src/main/java/io/lakefs/clients/api/AuthApi.java +src/main/java/io/lakefs/clients/api/BranchesApi.java +src/main/java/io/lakefs/clients/api/CommitsApi.java +src/main/java/io/lakefs/clients/api/ConfigApi.java +src/main/java/io/lakefs/clients/api/Configuration.java +src/main/java/io/lakefs/clients/api/ExperimentalApi.java +src/main/java/io/lakefs/clients/api/GzipRequestInterceptor.java +src/main/java/io/lakefs/clients/api/HealthCheckApi.java +src/main/java/io/lakefs/clients/api/ImportApi.java +src/main/java/io/lakefs/clients/api/InternalApi.java +src/main/java/io/lakefs/clients/api/JSON.java +src/main/java/io/lakefs/clients/api/MetadataApi.java +src/main/java/io/lakefs/clients/api/ObjectsApi.java +src/main/java/io/lakefs/clients/api/Pair.java +src/main/java/io/lakefs/clients/api/ProgressRequestBody.java +src/main/java/io/lakefs/clients/api/ProgressResponseBody.java +src/main/java/io/lakefs/clients/api/RefsApi.java +src/main/java/io/lakefs/clients/api/RepositoriesApi.java +src/main/java/io/lakefs/clients/api/RetentionApi.java +src/main/java/io/lakefs/clients/api/ServerConfiguration.java +src/main/java/io/lakefs/clients/api/ServerVariable.java +src/main/java/io/lakefs/clients/api/StagingApi.java +src/main/java/io/lakefs/clients/api/StringUtil.java +src/main/java/io/lakefs/clients/api/TagsApi.java +src/main/java/io/lakefs/clients/api/auth/ApiKeyAuth.java +src/main/java/io/lakefs/clients/api/auth/Authentication.java +src/main/java/io/lakefs/clients/api/auth/HttpBasicAuth.java +src/main/java/io/lakefs/clients/api/auth/HttpBearerAuth.java +src/main/java/io/lakefs/clients/api/model/ACL.java +src/main/java/io/lakefs/clients/api/model/AccessKeyCredentials.java +src/main/java/io/lakefs/clients/api/model/ActionRun.java +src/main/java/io/lakefs/clients/api/model/ActionRunList.java +src/main/java/io/lakefs/clients/api/model/AuthCapabilities.java +src/main/java/io/lakefs/clients/api/model/AuthenticationToken.java +src/main/java/io/lakefs/clients/api/model/BranchCreation.java +src/main/java/io/lakefs/clients/api/model/BranchProtectionRule.java +src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java +src/main/java/io/lakefs/clients/api/model/CommPrefsInput.java +src/main/java/io/lakefs/clients/api/model/Commit.java +src/main/java/io/lakefs/clients/api/model/CommitCreation.java +src/main/java/io/lakefs/clients/api/model/CommitList.java +src/main/java/io/lakefs/clients/api/model/Credentials.java +src/main/java/io/lakefs/clients/api/model/CredentialsList.java +src/main/java/io/lakefs/clients/api/model/CredentialsWithSecret.java +src/main/java/io/lakefs/clients/api/model/CurrentUser.java +src/main/java/io/lakefs/clients/api/model/Diff.java +src/main/java/io/lakefs/clients/api/model/DiffList.java +src/main/java/io/lakefs/clients/api/model/DiffProperties.java +src/main/java/io/lakefs/clients/api/model/Error.java +src/main/java/io/lakefs/clients/api/model/ErrorNoACL.java +src/main/java/io/lakefs/clients/api/model/FindMergeBaseResult.java +src/main/java/io/lakefs/clients/api/model/GarbageCollectionConfig.java +src/main/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponse.java +src/main/java/io/lakefs/clients/api/model/GarbageCollectionRule.java +src/main/java/io/lakefs/clients/api/model/GarbageCollectionRules.java +src/main/java/io/lakefs/clients/api/model/Group.java +src/main/java/io/lakefs/clients/api/model/GroupCreation.java +src/main/java/io/lakefs/clients/api/model/GroupList.java +src/main/java/io/lakefs/clients/api/model/HookRun.java +src/main/java/io/lakefs/clients/api/model/HookRunList.java +src/main/java/io/lakefs/clients/api/model/ImportCreation.java +src/main/java/io/lakefs/clients/api/model/ImportCreationResponse.java +src/main/java/io/lakefs/clients/api/model/ImportLocation.java +src/main/java/io/lakefs/clients/api/model/ImportStatus.java +src/main/java/io/lakefs/clients/api/model/InlineObject.java +src/main/java/io/lakefs/clients/api/model/InlineObject1.java +src/main/java/io/lakefs/clients/api/model/LoginConfig.java +src/main/java/io/lakefs/clients/api/model/LoginInformation.java +src/main/java/io/lakefs/clients/api/model/Merge.java +src/main/java/io/lakefs/clients/api/model/MergeResult.java +src/main/java/io/lakefs/clients/api/model/MetaRangeCreation.java +src/main/java/io/lakefs/clients/api/model/MetaRangeCreationResponse.java +src/main/java/io/lakefs/clients/api/model/OTFDiffs.java +src/main/java/io/lakefs/clients/api/model/ObjectCopyCreation.java +src/main/java/io/lakefs/clients/api/model/ObjectError.java +src/main/java/io/lakefs/clients/api/model/ObjectErrorList.java +src/main/java/io/lakefs/clients/api/model/ObjectStageCreation.java +src/main/java/io/lakefs/clients/api/model/ObjectStats.java +src/main/java/io/lakefs/clients/api/model/ObjectStatsList.java +src/main/java/io/lakefs/clients/api/model/OtfDiffEntry.java +src/main/java/io/lakefs/clients/api/model/OtfDiffList.java +src/main/java/io/lakefs/clients/api/model/Pagination.java +src/main/java/io/lakefs/clients/api/model/PathList.java +src/main/java/io/lakefs/clients/api/model/Policy.java +src/main/java/io/lakefs/clients/api/model/PolicyList.java +src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequest.java +src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponse.java +src/main/java/io/lakefs/clients/api/model/RangeMetadata.java +src/main/java/io/lakefs/clients/api/model/Ref.java +src/main/java/io/lakefs/clients/api/model/RefList.java +src/main/java/io/lakefs/clients/api/model/RefsDump.java +src/main/java/io/lakefs/clients/api/model/Repository.java +src/main/java/io/lakefs/clients/api/model/RepositoryCreation.java +src/main/java/io/lakefs/clients/api/model/RepositoryList.java +src/main/java/io/lakefs/clients/api/model/ResetCreation.java +src/main/java/io/lakefs/clients/api/model/RevertCreation.java +src/main/java/io/lakefs/clients/api/model/Setup.java +src/main/java/io/lakefs/clients/api/model/SetupState.java +src/main/java/io/lakefs/clients/api/model/StagingLocation.java +src/main/java/io/lakefs/clients/api/model/StagingMetadata.java +src/main/java/io/lakefs/clients/api/model/Statement.java +src/main/java/io/lakefs/clients/api/model/StatsEvent.java +src/main/java/io/lakefs/clients/api/model/StatsEventsList.java +src/main/java/io/lakefs/clients/api/model/StorageConfig.java +src/main/java/io/lakefs/clients/api/model/StorageURI.java +src/main/java/io/lakefs/clients/api/model/TagCreation.java +src/main/java/io/lakefs/clients/api/model/UnderlyingObjectProperties.java +src/main/java/io/lakefs/clients/api/model/UpdateToken.java +src/main/java/io/lakefs/clients/api/model/User.java +src/main/java/io/lakefs/clients/api/model/UserCreation.java +src/main/java/io/lakefs/clients/api/model/UserList.java +src/main/java/io/lakefs/clients/api/model/VersionConfig.java +src/test/java/io/lakefs/clients/api/ActionsApiTest.java +src/test/java/io/lakefs/clients/api/AuthApiTest.java +src/test/java/io/lakefs/clients/api/BranchesApiTest.java +src/test/java/io/lakefs/clients/api/CommitsApiTest.java +src/test/java/io/lakefs/clients/api/ConfigApiTest.java +src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java +src/test/java/io/lakefs/clients/api/HealthCheckApiTest.java +src/test/java/io/lakefs/clients/api/ImportApiTest.java +src/test/java/io/lakefs/clients/api/InternalApiTest.java +src/test/java/io/lakefs/clients/api/MetadataApiTest.java +src/test/java/io/lakefs/clients/api/ObjectsApiTest.java +src/test/java/io/lakefs/clients/api/RefsApiTest.java +src/test/java/io/lakefs/clients/api/RepositoriesApiTest.java +src/test/java/io/lakefs/clients/api/RetentionApiTest.java +src/test/java/io/lakefs/clients/api/StagingApiTest.java +src/test/java/io/lakefs/clients/api/TagsApiTest.java +src/test/java/io/lakefs/clients/api/model/ACLTest.java +src/test/java/io/lakefs/clients/api/model/AccessKeyCredentialsTest.java +src/test/java/io/lakefs/clients/api/model/ActionRunListTest.java +src/test/java/io/lakefs/clients/api/model/ActionRunTest.java +src/test/java/io/lakefs/clients/api/model/AuthCapabilitiesTest.java +src/test/java/io/lakefs/clients/api/model/AuthenticationTokenTest.java +src/test/java/io/lakefs/clients/api/model/BranchCreationTest.java +src/test/java/io/lakefs/clients/api/model/BranchProtectionRuleTest.java +src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java +src/test/java/io/lakefs/clients/api/model/CommPrefsInputTest.java +src/test/java/io/lakefs/clients/api/model/CommitCreationTest.java +src/test/java/io/lakefs/clients/api/model/CommitListTest.java +src/test/java/io/lakefs/clients/api/model/CommitTest.java +src/test/java/io/lakefs/clients/api/model/CredentialsListTest.java +src/test/java/io/lakefs/clients/api/model/CredentialsTest.java +src/test/java/io/lakefs/clients/api/model/CredentialsWithSecretTest.java +src/test/java/io/lakefs/clients/api/model/CurrentUserTest.java +src/test/java/io/lakefs/clients/api/model/DiffListTest.java +src/test/java/io/lakefs/clients/api/model/DiffPropertiesTest.java +src/test/java/io/lakefs/clients/api/model/DiffTest.java +src/test/java/io/lakefs/clients/api/model/ErrorNoACLTest.java +src/test/java/io/lakefs/clients/api/model/ErrorTest.java +src/test/java/io/lakefs/clients/api/model/FindMergeBaseResultTest.java +src/test/java/io/lakefs/clients/api/model/GarbageCollectionConfigTest.java +src/test/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponseTest.java +src/test/java/io/lakefs/clients/api/model/GarbageCollectionRuleTest.java +src/test/java/io/lakefs/clients/api/model/GarbageCollectionRulesTest.java +src/test/java/io/lakefs/clients/api/model/GroupCreationTest.java +src/test/java/io/lakefs/clients/api/model/GroupListTest.java +src/test/java/io/lakefs/clients/api/model/GroupTest.java +src/test/java/io/lakefs/clients/api/model/HookRunListTest.java +src/test/java/io/lakefs/clients/api/model/HookRunTest.java +src/test/java/io/lakefs/clients/api/model/ImportCreationResponseTest.java +src/test/java/io/lakefs/clients/api/model/ImportCreationTest.java +src/test/java/io/lakefs/clients/api/model/ImportLocationTest.java +src/test/java/io/lakefs/clients/api/model/ImportStatusTest.java +src/test/java/io/lakefs/clients/api/model/InlineObject1Test.java +src/test/java/io/lakefs/clients/api/model/InlineObjectTest.java +src/test/java/io/lakefs/clients/api/model/LoginConfigTest.java +src/test/java/io/lakefs/clients/api/model/LoginInformationTest.java +src/test/java/io/lakefs/clients/api/model/MergeResultTest.java +src/test/java/io/lakefs/clients/api/model/MergeTest.java +src/test/java/io/lakefs/clients/api/model/MetaRangeCreationResponseTest.java +src/test/java/io/lakefs/clients/api/model/MetaRangeCreationTest.java +src/test/java/io/lakefs/clients/api/model/OTFDiffsTest.java +src/test/java/io/lakefs/clients/api/model/ObjectCopyCreationTest.java +src/test/java/io/lakefs/clients/api/model/ObjectErrorListTest.java +src/test/java/io/lakefs/clients/api/model/ObjectErrorTest.java +src/test/java/io/lakefs/clients/api/model/ObjectStageCreationTest.java +src/test/java/io/lakefs/clients/api/model/ObjectStatsListTest.java +src/test/java/io/lakefs/clients/api/model/ObjectStatsTest.java +src/test/java/io/lakefs/clients/api/model/OtfDiffEntryTest.java +src/test/java/io/lakefs/clients/api/model/OtfDiffListTest.java +src/test/java/io/lakefs/clients/api/model/PaginationTest.java +src/test/java/io/lakefs/clients/api/model/PathListTest.java +src/test/java/io/lakefs/clients/api/model/PolicyListTest.java +src/test/java/io/lakefs/clients/api/model/PolicyTest.java +src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequestTest.java +src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponseTest.java +src/test/java/io/lakefs/clients/api/model/RangeMetadataTest.java +src/test/java/io/lakefs/clients/api/model/RefListTest.java +src/test/java/io/lakefs/clients/api/model/RefTest.java +src/test/java/io/lakefs/clients/api/model/RefsDumpTest.java +src/test/java/io/lakefs/clients/api/model/RepositoryCreationTest.java +src/test/java/io/lakefs/clients/api/model/RepositoryListTest.java +src/test/java/io/lakefs/clients/api/model/RepositoryTest.java +src/test/java/io/lakefs/clients/api/model/ResetCreationTest.java +src/test/java/io/lakefs/clients/api/model/RevertCreationTest.java +src/test/java/io/lakefs/clients/api/model/SetupStateTest.java +src/test/java/io/lakefs/clients/api/model/SetupTest.java +src/test/java/io/lakefs/clients/api/model/StagingLocationTest.java +src/test/java/io/lakefs/clients/api/model/StagingMetadataTest.java +src/test/java/io/lakefs/clients/api/model/StatementTest.java +src/test/java/io/lakefs/clients/api/model/StatsEventTest.java +src/test/java/io/lakefs/clients/api/model/StatsEventsListTest.java +src/test/java/io/lakefs/clients/api/model/StorageConfigTest.java +src/test/java/io/lakefs/clients/api/model/StorageURITest.java +src/test/java/io/lakefs/clients/api/model/TagCreationTest.java +src/test/java/io/lakefs/clients/api/model/UnderlyingObjectPropertiesTest.java +src/test/java/io/lakefs/clients/api/model/UpdateTokenTest.java +src/test/java/io/lakefs/clients/api/model/UserCreationTest.java +src/test/java/io/lakefs/clients/api/model/UserListTest.java +src/test/java/io/lakefs/clients/api/model/UserTest.java +src/test/java/io/lakefs/clients/api/model/VersionConfigTest.java diff --git a/clients/java-legacy/.openapi-generator/VERSION b/clients/java-legacy/.openapi-generator/VERSION new file mode 100644 index 00000000000..e230c8396d1 --- /dev/null +++ b/clients/java-legacy/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.0 \ No newline at end of file diff --git a/clients/java-legacy/.travis.yml b/clients/java-legacy/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/clients/java-legacy/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/clients/java-legacy/README.md b/clients/java-legacy/README.md new file mode 100644 index 00000000000..1de03ea9ebe --- /dev/null +++ b/clients/java-legacy/README.md @@ -0,0 +1,365 @@ +# api-client + +lakeFS API +- API version: 0.1.0 + +lakeFS HTTP API + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + io.lakefs + api-client + 0.1.0-SNAPSHOT + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "io.lakefs:api-client:0.1.0-SNAPSHOT" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/api-client-0.1.0-SNAPSHOT.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ActionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ActionsApi apiInstance = new ActionsApi(defaultClient); + String repository = "repository_example"; // String | + String runId = "runId_example"; // String | + try { + ActionRun result = apiInstance.getRun(repository, runId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsApi#getRun"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActionsApi* | [**getRun**](docs/ActionsApi.md#getRun) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run +*ActionsApi* | [**getRunHookOutput**](docs/ActionsApi.md#getRunHookOutput) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output +*ActionsApi* | [**listRepositoryRuns**](docs/ActionsApi.md#listRepositoryRuns) | **GET** /repositories/{repository}/actions/runs | list runs +*ActionsApi* | [**listRunHooks**](docs/ActionsApi.md#listRunHooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks +*AuthApi* | [**addGroupMembership**](docs/AuthApi.md#addGroupMembership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership +*AuthApi* | [**attachPolicyToGroup**](docs/AuthApi.md#attachPolicyToGroup) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group +*AuthApi* | [**attachPolicyToUser**](docs/AuthApi.md#attachPolicyToUser) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user +*AuthApi* | [**createCredentials**](docs/AuthApi.md#createCredentials) | **POST** /auth/users/{userId}/credentials | create credentials +*AuthApi* | [**createGroup**](docs/AuthApi.md#createGroup) | **POST** /auth/groups | create group +*AuthApi* | [**createPolicy**](docs/AuthApi.md#createPolicy) | **POST** /auth/policies | create policy +*AuthApi* | [**createUser**](docs/AuthApi.md#createUser) | **POST** /auth/users | create user +*AuthApi* | [**deleteCredentials**](docs/AuthApi.md#deleteCredentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials +*AuthApi* | [**deleteGroup**](docs/AuthApi.md#deleteGroup) | **DELETE** /auth/groups/{groupId} | delete group +*AuthApi* | [**deleteGroupMembership**](docs/AuthApi.md#deleteGroupMembership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership +*AuthApi* | [**deletePolicy**](docs/AuthApi.md#deletePolicy) | **DELETE** /auth/policies/{policyId} | delete policy +*AuthApi* | [**deleteUser**](docs/AuthApi.md#deleteUser) | **DELETE** /auth/users/{userId} | delete user +*AuthApi* | [**detachPolicyFromGroup**](docs/AuthApi.md#detachPolicyFromGroup) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group +*AuthApi* | [**detachPolicyFromUser**](docs/AuthApi.md#detachPolicyFromUser) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user +*AuthApi* | [**getCredentials**](docs/AuthApi.md#getCredentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials +*AuthApi* | [**getCurrentUser**](docs/AuthApi.md#getCurrentUser) | **GET** /user | get current user +*AuthApi* | [**getGroup**](docs/AuthApi.md#getGroup) | **GET** /auth/groups/{groupId} | get group +*AuthApi* | [**getGroupACL**](docs/AuthApi.md#getGroupACL) | **GET** /auth/groups/{groupId}/acl | get ACL of group +*AuthApi* | [**getPolicy**](docs/AuthApi.md#getPolicy) | **GET** /auth/policies/{policyId} | get policy +*AuthApi* | [**getUser**](docs/AuthApi.md#getUser) | **GET** /auth/users/{userId} | get user +*AuthApi* | [**listGroupMembers**](docs/AuthApi.md#listGroupMembers) | **GET** /auth/groups/{groupId}/members | list group members +*AuthApi* | [**listGroupPolicies**](docs/AuthApi.md#listGroupPolicies) | **GET** /auth/groups/{groupId}/policies | list group policies +*AuthApi* | [**listGroups**](docs/AuthApi.md#listGroups) | **GET** /auth/groups | list groups +*AuthApi* | [**listPolicies**](docs/AuthApi.md#listPolicies) | **GET** /auth/policies | list policies +*AuthApi* | [**listUserCredentials**](docs/AuthApi.md#listUserCredentials) | **GET** /auth/users/{userId}/credentials | list user credentials +*AuthApi* | [**listUserGroups**](docs/AuthApi.md#listUserGroups) | **GET** /auth/users/{userId}/groups | list user groups +*AuthApi* | [**listUserPolicies**](docs/AuthApi.md#listUserPolicies) | **GET** /auth/users/{userId}/policies | list user policies +*AuthApi* | [**listUsers**](docs/AuthApi.md#listUsers) | **GET** /auth/users | list users +*AuthApi* | [**login**](docs/AuthApi.md#login) | **POST** /auth/login | perform a login +*AuthApi* | [**setGroupACL**](docs/AuthApi.md#setGroupACL) | **POST** /auth/groups/{groupId}/acl | set ACL of group +*AuthApi* | [**updatePolicy**](docs/AuthApi.md#updatePolicy) | **PUT** /auth/policies/{policyId} | update policy +*BranchesApi* | [**cherryPick**](docs/BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Replay the changes from the given commit on the branch +*BranchesApi* | [**createBranch**](docs/BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch +*BranchesApi* | [**deleteBranch**](docs/BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch +*BranchesApi* | [**diffBranch**](docs/BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch +*BranchesApi* | [**getBranch**](docs/BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch +*BranchesApi* | [**listBranches**](docs/BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches +*BranchesApi* | [**resetBranch**](docs/BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch +*BranchesApi* | [**revertBranch**](docs/BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert +*CommitsApi* | [**commit**](docs/CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit +*CommitsApi* | [**getCommit**](docs/CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit +*ConfigApi* | [**getGarbageCollectionConfig**](docs/ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | +*ConfigApi* | [**getLakeFSVersion**](docs/ConfigApi.md#getLakeFSVersion) | **GET** /config/version | +*ConfigApi* | [**getStorageConfig**](docs/ConfigApi.md#getStorageConfig) | **GET** /config/storage | +*ExperimentalApi* | [**getOtfDiffs**](docs/ExperimentalApi.md#getOtfDiffs) | **GET** /otf/diffs | get the available Open Table Format diffs +*ExperimentalApi* | [**otfDiff**](docs/ExperimentalApi.md#otfDiff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff +*HealthCheckApi* | [**healthCheck**](docs/HealthCheckApi.md#healthCheck) | **GET** /healthcheck | +*ImportApi* | [**importCancel**](docs/ImportApi.md#importCancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import +*ImportApi* | [**importStart**](docs/ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store +*ImportApi* | [**importStatus**](docs/ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status +*InternalApi* | [**createBranchProtectionRulePreflight**](docs/InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +*InternalApi* | [**createSymlinkFile**](docs/InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory +*InternalApi* | [**getAuthCapabilities**](docs/InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported +*InternalApi* | [**getSetupState**](docs/InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +*InternalApi* | [**postStatsEvents**](docs/InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only +*InternalApi* | [**setGarbageCollectionRulesPreflight**](docs/InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | +*InternalApi* | [**setup**](docs/InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user +*InternalApi* | [**setupCommPrefs**](docs/InternalApi.md#setupCommPrefs) | **POST** /setup_comm_prefs | setup communications preferences +*InternalApi* | [**uploadObjectPreflight**](docs/InternalApi.md#uploadObjectPreflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | +*MetadataApi* | [**getMetaRange**](docs/MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file +*MetadataApi* | [**getRange**](docs/MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file +*ObjectsApi* | [**copyObject**](docs/ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object +*ObjectsApi* | [**deleteObject**](docs/ObjectsApi.md#deleteObject) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. +*ObjectsApi* | [**deleteObjects**](docs/ObjectsApi.md#deleteObjects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. +*ObjectsApi* | [**getObject**](docs/ObjectsApi.md#getObject) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content +*ObjectsApi* | [**getUnderlyingProperties**](docs/ObjectsApi.md#getUnderlyingProperties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage +*ObjectsApi* | [**headObject**](docs/ObjectsApi.md#headObject) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists +*ObjectsApi* | [**listObjects**](docs/ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix +*ObjectsApi* | [**stageObject**](docs/ObjectsApi.md#stageObject) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch +*ObjectsApi* | [**statObject**](docs/ObjectsApi.md#statObject) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata +*ObjectsApi* | [**uploadObject**](docs/ObjectsApi.md#uploadObject) | **POST** /repositories/{repository}/branches/{branch}/objects | +*RefsApi* | [**diffRefs**](docs/RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references +*RefsApi* | [**dumpRefs**](docs/RefsApi.md#dumpRefs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store +*RefsApi* | [**findMergeBase**](docs/RefsApi.md#findMergeBase) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references +*RefsApi* | [**logCommits**](docs/RefsApi.md#logCommits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. +*RefsApi* | [**mergeIntoBranch**](docs/RefsApi.md#mergeIntoBranch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references +*RefsApi* | [**restoreRefs**](docs/RefsApi.md#restoreRefs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store +*RepositoriesApi* | [**createBranchProtectionRule**](docs/RepositoriesApi.md#createBranchProtectionRule) | **POST** /repositories/{repository}/branch_protection | +*RepositoriesApi* | [**createRepository**](docs/RepositoriesApi.md#createRepository) | **POST** /repositories | create repository +*RepositoriesApi* | [**deleteBranchProtectionRule**](docs/RepositoriesApi.md#deleteBranchProtectionRule) | **DELETE** /repositories/{repository}/branch_protection | +*RepositoriesApi* | [**deleteRepository**](docs/RepositoriesApi.md#deleteRepository) | **DELETE** /repositories/{repository} | delete repository +*RepositoriesApi* | [**getBranchProtectionRules**](docs/RepositoriesApi.md#getBranchProtectionRules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules +*RepositoriesApi* | [**getRepository**](docs/RepositoriesApi.md#getRepository) | **GET** /repositories/{repository} | get repository +*RepositoriesApi* | [**getRepositoryMetadata**](docs/RepositoriesApi.md#getRepositoryMetadata) | **GET** /repositories/{repository}/metadata | get repository metadata +*RepositoriesApi* | [**listRepositories**](docs/RepositoriesApi.md#listRepositories) | **GET** /repositories | list repositories +*RetentionApi* | [**deleteGarbageCollectionRules**](docs/RetentionApi.md#deleteGarbageCollectionRules) | **DELETE** /repositories/{repository}/gc/rules | +*RetentionApi* | [**getGarbageCollectionRules**](docs/RetentionApi.md#getGarbageCollectionRules) | **GET** /repositories/{repository}/gc/rules | +*RetentionApi* | [**prepareGarbageCollectionCommits**](docs/RetentionApi.md#prepareGarbageCollectionCommits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active commits for garbage collection +*RetentionApi* | [**prepareGarbageCollectionUncommitted**](docs/RetentionApi.md#prepareGarbageCollectionUncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection +*RetentionApi* | [**setGarbageCollectionRules**](docs/RetentionApi.md#setGarbageCollectionRules) | **POST** /repositories/{repository}/gc/rules | +*StagingApi* | [**getPhysicalAddress**](docs/StagingApi.md#getPhysicalAddress) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage +*StagingApi* | [**linkPhysicalAddress**](docs/StagingApi.md#linkPhysicalAddress) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path +*TagsApi* | [**createTag**](docs/TagsApi.md#createTag) | **POST** /repositories/{repository}/tags | create tag +*TagsApi* | [**deleteTag**](docs/TagsApi.md#deleteTag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag +*TagsApi* | [**getTag**](docs/TagsApi.md#getTag) | **GET** /repositories/{repository}/tags/{tag} | get tag +*TagsApi* | [**listTags**](docs/TagsApi.md#listTags) | **GET** /repositories/{repository}/tags | list tags + + +## Documentation for Models + + - [ACL](docs/ACL.md) + - [AccessKeyCredentials](docs/AccessKeyCredentials.md) + - [ActionRun](docs/ActionRun.md) + - [ActionRunList](docs/ActionRunList.md) + - [AuthCapabilities](docs/AuthCapabilities.md) + - [AuthenticationToken](docs/AuthenticationToken.md) + - [BranchCreation](docs/BranchCreation.md) + - [BranchProtectionRule](docs/BranchProtectionRule.md) + - [CherryPickCreation](docs/CherryPickCreation.md) + - [CommPrefsInput](docs/CommPrefsInput.md) + - [Commit](docs/Commit.md) + - [CommitCreation](docs/CommitCreation.md) + - [CommitList](docs/CommitList.md) + - [Credentials](docs/Credentials.md) + - [CredentialsList](docs/CredentialsList.md) + - [CredentialsWithSecret](docs/CredentialsWithSecret.md) + - [CurrentUser](docs/CurrentUser.md) + - [Diff](docs/Diff.md) + - [DiffList](docs/DiffList.md) + - [DiffProperties](docs/DiffProperties.md) + - [Error](docs/Error.md) + - [ErrorNoACL](docs/ErrorNoACL.md) + - [FindMergeBaseResult](docs/FindMergeBaseResult.md) + - [GarbageCollectionConfig](docs/GarbageCollectionConfig.md) + - [GarbageCollectionPrepareResponse](docs/GarbageCollectionPrepareResponse.md) + - [GarbageCollectionRule](docs/GarbageCollectionRule.md) + - [GarbageCollectionRules](docs/GarbageCollectionRules.md) + - [Group](docs/Group.md) + - [GroupCreation](docs/GroupCreation.md) + - [GroupList](docs/GroupList.md) + - [HookRun](docs/HookRun.md) + - [HookRunList](docs/HookRunList.md) + - [ImportCreation](docs/ImportCreation.md) + - [ImportCreationResponse](docs/ImportCreationResponse.md) + - [ImportLocation](docs/ImportLocation.md) + - [ImportStatus](docs/ImportStatus.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [LoginConfig](docs/LoginConfig.md) + - [LoginInformation](docs/LoginInformation.md) + - [Merge](docs/Merge.md) + - [MergeResult](docs/MergeResult.md) + - [MetaRangeCreation](docs/MetaRangeCreation.md) + - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) + - [OTFDiffs](docs/OTFDiffs.md) + - [ObjectCopyCreation](docs/ObjectCopyCreation.md) + - [ObjectError](docs/ObjectError.md) + - [ObjectErrorList](docs/ObjectErrorList.md) + - [ObjectStageCreation](docs/ObjectStageCreation.md) + - [ObjectStats](docs/ObjectStats.md) + - [ObjectStatsList](docs/ObjectStatsList.md) + - [OtfDiffEntry](docs/OtfDiffEntry.md) + - [OtfDiffList](docs/OtfDiffList.md) + - [Pagination](docs/Pagination.md) + - [PathList](docs/PathList.md) + - [Policy](docs/Policy.md) + - [PolicyList](docs/PolicyList.md) + - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) + - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) + - [RangeMetadata](docs/RangeMetadata.md) + - [Ref](docs/Ref.md) + - [RefList](docs/RefList.md) + - [RefsDump](docs/RefsDump.md) + - [Repository](docs/Repository.md) + - [RepositoryCreation](docs/RepositoryCreation.md) + - [RepositoryList](docs/RepositoryList.md) + - [ResetCreation](docs/ResetCreation.md) + - [RevertCreation](docs/RevertCreation.md) + - [Setup](docs/Setup.md) + - [SetupState](docs/SetupState.md) + - [StagingLocation](docs/StagingLocation.md) + - [StagingMetadata](docs/StagingMetadata.md) + - [Statement](docs/Statement.md) + - [StatsEvent](docs/StatsEvent.md) + - [StatsEventsList](docs/StatsEventsList.md) + - [StorageConfig](docs/StorageConfig.md) + - [StorageURI](docs/StorageURI.md) + - [TagCreation](docs/TagCreation.md) + - [UnderlyingObjectProperties](docs/UnderlyingObjectProperties.md) + - [UpdateToken](docs/UpdateToken.md) + - [User](docs/User.md) + - [UserCreation](docs/UserCreation.md) + - [UserList](docs/UserList.md) + - [VersionConfig](docs/VersionConfig.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### basic_auth + +- **Type**: HTTP basic authentication + +### cookie_auth + +- **Type**: API key +- **API key parameter name**: internal_auth_session +- **Location**: + +### jwt_token + +- **Type**: HTTP basic authentication + +### oidc_auth + +- **Type**: API key +- **API key parameter name**: oidc_auth_session +- **Location**: + +### saml_auth + +- **Type**: API key +- **API key parameter name**: saml_auth_session +- **Location**: + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/clients/java-legacy/api/openapi.yaml b/clients/java-legacy/api/openapi.yaml new file mode 100644 index 00000000000..d9e2a76e6c2 --- /dev/null +++ b/clients/java-legacy/api/openapi.yaml @@ -0,0 +1,7186 @@ +openapi: 3.0.0 +info: + description: lakeFS HTTP API + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: lakeFS API + version: 0.1.0 +servers: +- description: lakeFS server endpoint + url: /api/v1 +security: +- jwt_token: [] +- basic_auth: [] +- cookie_auth: [] +- oidc_auth: [] +- saml_auth: [] +paths: + /setup_comm_prefs: + post: + operationId: setupCommPrefs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommPrefsInput' + required: true + responses: + "200": + description: communication preferences saved successfully + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: setup was already completed + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: wrong setup state for this operation + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + security: [] + summary: setup communications preferences + tags: + - internal + x-contentType: application/json + x-accepts: application/json + /setup_lakefs: + get: + operationId: getSetupState + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetupState' + description: lakeFS setup state + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + security: [] + summary: check if the lakeFS installation is already set up + tags: + - internal + x-accepts: application/json + post: + operationId: setup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Setup' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsWithSecret' + description: user created successfully + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad Request + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: setup was already called + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + security: [] + summary: setup lakeFS and create a first user + tags: + - internal + x-contentType: application/json + x-accepts: application/json + /user: + get: + operationId: getCurrentUser + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CurrentUser' + description: user + summary: get current user + tags: + - auth + x-accepts: application/json + /auth/login: + post: + operationId: login + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LoginInformation' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationToken' + description: successful login + headers: + Set-Cookie: + explode: false + schema: + example: access_token=abcde12356; Path=/; HttpOnly + type: string + style: simple + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + security: [] + summary: perform a login + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /auth/capabilities: + get: + operationId: getAuthCapabilities + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AuthCapabilities' + description: auth capabilities + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + security: [] + summary: list authentication capabilities supported + tags: + - internal + x-accepts: application/json + /auth/users: + get: + operationId: listUsers + parameters: + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: user list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list users + tags: + - auth + x-accepts: application/json + post: + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreation' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: user + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: validation error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create user + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /auth/users/{userId}: + delete: + operationId: deleteUser + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "204": + description: user deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete user + tags: + - auth + x-accepts: application/json + get: + operationId: getUser + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: user + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get user + tags: + - auth + x-accepts: application/json + /auth/groups: + get: + operationId: listGroups + parameters: + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GroupList' + description: group list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list groups + tags: + - auth + x-accepts: application/json + post: + operationId: createGroup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreation' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + description: group + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create group + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /auth/groups/{groupId}: + delete: + operationId: deleteGroup + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + responses: + "204": + description: group deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete group + tags: + - auth + x-accepts: application/json + get: + operationId: getGroup + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + description: group + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get group + tags: + - auth + x-accepts: application/json + /auth/policies: + get: + operationId: listPolicies + parameters: + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyList' + description: policy list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list policies + tags: + - auth + x-accepts: application/json + post: + operationId: createPolicy + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + description: policy + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create policy + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /auth/policies/{policyId}: + delete: + operationId: deletePolicy + parameters: + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "204": + description: policy deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete policy + tags: + - auth + x-accepts: application/json + get: + operationId: getPolicy + parameters: + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + description: policy + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get policy + tags: + - auth + x-accepts: application/json + put: + operationId: updatePolicy + parameters: + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + description: policy + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: update policy + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /auth/groups/{groupId}/members: + get: + operationId: listGroupMembers + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: group member list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list group members + tags: + - auth + x-accepts: application/json + /auth/groups/{groupId}/members/{userId}: + delete: + operationId: deleteGroupMembership + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "204": + description: membership deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete group membership + tags: + - auth + x-accepts: application/json + put: + operationId: addGroupMembership + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "201": + description: membership added successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: add group membership + tags: + - auth + x-accepts: application/json + /auth/users/{userId}/credentials: + get: + operationId: listUserCredentials + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsList' + description: credential list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list user credentials + tags: + - auth + x-accepts: application/json + post: + operationId: createCredentials + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialsWithSecret' + description: credentials + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create credentials + tags: + - auth + x-accepts: application/json + /auth/users/{userId}/credentials/{accessKeyId}: + delete: + operationId: deleteCredentials + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: accessKeyId + required: true + schema: + type: string + style: simple + responses: + "204": + description: credentials deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete credentials + tags: + - auth + x-accepts: application/json + get: + operationId: getCredentials + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: accessKeyId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Credentials' + description: credentials + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get credentials + tags: + - auth + x-accepts: application/json + /auth/users/{userId}/groups: + get: + operationId: listUserGroups + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GroupList' + description: group list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list user groups + tags: + - auth + x-accepts: application/json + /auth/users/{userId}/policies: + get: + operationId: listUserPolicies + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - description: will return all distinct policies attached to the user or any + of its groups + explode: true + in: query + name: effective + required: false + schema: + default: false + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyList' + description: policy list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list user policies + tags: + - auth + x-accepts: application/json + /auth/users/{userId}/policies/{policyId}: + delete: + operationId: detachPolicyFromUser + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "204": + description: policy detached successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: detach policy from user + tags: + - auth + x-accepts: application/json + put: + operationId: attachPolicyToUser + parameters: + - explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "201": + description: policy attached successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: attach policy to user + tags: + - auth + x-accepts: application/json + /auth/groups/{groupId}/policies: + get: + operationId: listGroupPolicies + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyList' + description: policy list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list group policies + tags: + - auth + x-accepts: application/json + /auth/groups/{groupId}/policies/{policyId}: + delete: + operationId: detachPolicyFromGroup + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "204": + description: policy detached successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: detach policy from group + tags: + - auth + x-accepts: application/json + put: + operationId: attachPolicyToGroup + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: policyId + required: true + schema: + type: string + style: simple + responses: + "201": + description: policy attached successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: attach policy to group + tags: + - auth + x-accepts: application/json + /auth/groups/{groupId}/acl: + get: + operationId: getGroupACL + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ACL' + description: ACL of group + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorNoACL' + description: Group not found, or group found but has no ACL + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get ACL of group + tags: + - auth + x-accepts: application/json + post: + operationId: setGroupACL + parameters: + - explode: false + in: path + name: groupId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ACL' + required: true + responses: + "201": + description: ACL successfully changed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: set ACL of group + tags: + - auth + x-contentType: application/json + x-accepts: application/json + /repositories: + get: + operationId: listRepositories + parameters: + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryList' + description: repository list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list repositories + tags: + - repositories + x-accepts: application/json + post: + operationId: createRepository + parameters: + - description: If true, create a bare repository with no initial commit and + branch + explode: true + in: query + name: bare + required: false + schema: + default: false + type: boolean + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + description: repository + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create repository + tags: + - repositories + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}: + delete: + operationId: deleteRepository + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "204": + description: repository deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete repository + tags: + - repositories + x-accepts: application/json + get: + operationId: getRepository + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + description: repository + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get repository + tags: + - repositories + x-accepts: application/json + /repositories/{repository}/metadata: + get: + operationId: getRepositoryMetadata + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryMetadata' + description: repository metadata + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get repository metadata + tags: + - repositories + x-accepts: application/json + /otf/diffs: + get: + operationId: getOtfDiffs + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OTFDiffs' + description: available Open Table Format diffs + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get the available Open Table Format diffs + tags: + - experimental + x-accepts: application/json + /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref}: + get: + operationId: otfDiff + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: left_ref + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: right_ref + required: true + schema: + type: string + style: simple + - description: a path to the table location under the specified ref. + explode: true + in: query + name: table_path + required: true + schema: + type: string + style: form + - description: the type of otf + explode: true + in: query + name: type + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OtfDiffList' + description: diff list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: perform otf diff + tags: + - experimental + x-accepts: application/json + /repositories/{repository}/refs/dump: + put: + operationId: dumpRefs + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/RefsDump' + description: refs dump + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Dump repository refs (tags, commits, branches) to object store + tags: + - refs + x-accepts: application/json + /repositories/{repository}/refs/restore: + put: + operationId: restoreRefs + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefsDump' + required: true + responses: + "200": + description: refs successfully loaded + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Restore repository refs (tags, commits, branches) from object store + tags: + - refs + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/tags: + get: + operationId: listTags + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RefList' + description: tag list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list tags + tags: + - tags + x-accepts: application/json + post: + operationId: createTag + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TagCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Ref' + description: tag + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create tag + tags: + - tags + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/tags/{tag}: + delete: + operationId: deleteTag + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: tag + required: true + schema: + type: string + style: simple + responses: + "204": + description: tag deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete tag + tags: + - tags + x-accepts: application/json + get: + operationId: getTag + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: tag + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Ref' + description: tag + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get tag + tags: + - tags + x-accepts: application/json + /repositories/{repository}/branches: + get: + operationId: listBranches + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RefList' + description: branch list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list branches + tags: + - branches + x-accepts: application/json + post: + operationId: createBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BranchCreation' + required: true + responses: + "201": + content: + text/html: + schema: + type: string + description: reference + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create branch + tags: + - branches + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/refs/{ref}/commits: + get: + operationId: logCommits + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - description: list of paths, each element is a path of a specific object + explode: true + in: query + name: objects + required: false + schema: + items: + type: string + type: array + style: form + - description: list of paths, each element is a path of a prefix + explode: true + in: query + name: prefixes + required: false + schema: + items: + type: string + type: array + style: form + - description: limit the number of items in return to 'amount'. Without further + indication on actual number of items. + explode: true + in: query + name: limit + required: false + schema: + type: boolean + style: form + - description: if set to true, follow only the first parent upon reaching a + merge commit + explode: true + in: query + name: first_parent + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CommitList' + description: commit log + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get commit log from ref. If both objects and prefixes are empty, return + all commits. + tags: + - refs + x-accepts: application/json + /repositories/{repository}/branches/{branch}/commits: + post: + operationId: commit + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: The source metarange to commit. Branch must not have uncommitted + changes. + explode: true + in: query + name: source_metarange + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Commit' + description: commit + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed (e.g. a pre-commit hook returned a failure) + summary: create commit + tags: + - commits + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}: + delete: + operationId: deleteBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + responses: + "204": + description: branch deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete branch + tags: + - branches + x-accepts: application/json + get: + operationId: getBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Ref' + description: branch + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get branch + tags: + - branches + x-accepts: application/json + put: + operationId: resetBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetCreation' + required: true + responses: + "204": + description: reset successful + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: reset branch + tags: + - branches + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/revert: + post: + operationId: revertBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RevertCreation' + required: true + responses: + "204": + description: revert successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Conflict Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: revert + tags: + - branches + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/cherry-pick: + post: + operationId: cherryPick + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CherryPickCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Commit' + description: the cherry-pick commit + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Conflict Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Replay the changes from the given commit on the branch + tags: + - branches + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: + get: + operationId: findMergeBase + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: source ref + explode: false + in: path + name: sourceRef + required: true + schema: + type: string + style: simple + - description: destination branch name + explode: false + in: path + name: destinationBranch + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FindMergeBaseResult' + description: Found the merge base + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: find the merge base for 2 references + tags: + - refs + x-accepts: application/json + post: + operationId: mergeIntoBranch + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: source ref + explode: false + in: path + name: sourceRef + required: true + schema: + type: string + style: simple + - description: destination branch name + explode: false + in: path + name: destinationBranch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Merge' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MergeResult' + description: merge completed + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/MergeResult' + description: | + Conflict + Deprecated: content schema will return Error format and not an empty MergeResult + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: precondition failed (e.g. a pre-merge hook returned a failure) + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: merge references + tags: + - refs + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/diff: + get: + operationId: diffBranch + parameters: + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: delimiter used to group common prefixes by + explode: true + in: query + name: delimiter + required: false + schema: + type: string + style: form + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiffList' + description: diff of branch uncommitted changes + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: diff branch + tags: + - branches + x-accepts: application/json + /repositories/{repository}/refs/{leftRef}/diff/{rightRef}: + get: + operationId: diffRefs + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: leftRef + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) to compare + against + explode: false + in: path + name: rightRef + required: true + schema: + type: string + style: simple + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + - description: delimiter used to group common prefixes by + explode: true + in: query + name: delimiter + required: false + schema: + type: string + style: form + - explode: true + in: query + name: type + required: false + schema: + default: three_dot + enum: + - two_dot + - three_dot + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiffList' + description: diff between refs + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: diff references + tags: + - refs + x-accepts: application/json + /repositories/{repository}/commits/{commitId}: + get: + operationId: getCommit + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: commitId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Commit' + description: commit + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get commit + tags: + - commits + x-accepts: application/json + /repositories/{repository}/refs/{ref}/objects: + get: + operationId: getObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - description: relative to the ref + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + - description: Byte range to retrieve + example: bytes=0-1023 + explode: false + in: header + name: Range + required: false + schema: + pattern: ^bytes=((\d*-\d*,? ?)+)$ + type: string + style: simple + - explode: true + in: query + name: presign + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: object content + headers: + Content-Length: + explode: false + schema: + format: int64 + type: integer + style: simple + Last-Modified: + explode: false + schema: + type: string + style: simple + ETag: + explode: false + schema: + type: string + style: simple + "206": + content: + application/octet-stream: + schema: + format: binary + type: string + description: partial object content + headers: + Content-Length: + explode: false + schema: + format: int64 + type: integer + style: simple + Content-Range: + explode: false + schema: + pattern: ^bytes=((\d*-\d*,? ?)+)$ + type: string + style: simple + Last-Modified: + explode: false + schema: + type: string + style: simple + ETag: + explode: false + schema: + type: string + style: simple + "302": + description: Redirect to a pre-signed URL for the object + headers: + Location: + explode: false + schema: + type: string + style: simple + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + "410": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: object expired + "416": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Requested Range Not Satisfiable + summary: get object content + tags: + - objects + x-accepts: application/json + head: + operationId: headObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - description: relative to the ref + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + - description: Byte range to retrieve + example: bytes=0-1023 + explode: false + in: header + name: Range + required: false + schema: + pattern: ^bytes=((\d*-\d*,? ?)+)$ + type: string + style: simple + responses: + "200": + description: object exists + headers: + Content-Length: + explode: false + schema: + format: int64 + type: integer + style: simple + Last-Modified: + explode: false + schema: + type: string + style: simple + ETag: + explode: false + schema: + type: string + style: simple + "206": + description: partial object content info + headers: + Content-Length: + explode: false + schema: + format: int64 + type: integer + style: simple + Content-Range: + explode: false + schema: + pattern: ^bytes=((\d*-\d*,? ?)+)$ + type: string + style: simple + Last-Modified: + explode: false + schema: + type: string + style: simple + ETag: + explode: false + schema: + type: string + style: simple + "401": + description: Unauthorized + "404": + description: object not found + "410": + description: object expired + "416": + description: Requested Range Not Satisfiable + default: + description: internal server error + summary: check if object exists + tags: + - objects + x-accepts: application/json + /repositories/{repository}/branches/{branch}/staging/backing: + get: + operationId: getPhysicalAddress + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + - explode: true + in: query + name: presign + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StagingLocation' + description: physical address for staging area + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get a physical address and a return token to write object to underlying + storage + tags: + - staging + x-accepts: application/json + put: + description: | + If the supplied token matches the current staging token, associate the object as the + physical address with the supplied path. + + Otherwise, if staging has been committed and the token has expired, return a conflict + and hint where to place the object to try again. Caller should copy the object to the + new physical address and PUT again with the new staging token. (No need to back off, + this is due to losing the race against a concurrent commit operation.) + operationId: linkPhysicalAddress + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StagingMetadata' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStats' + description: object metadata + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/StagingLocation' + description: conflict with a commit, try here + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: associate staging on this physical address with a path + tags: + - staging + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/import: + delete: + operationId: importCancel + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: Unique identifier of the import process + explode: true + in: query + name: id + required: true + schema: + type: string + style: form + responses: + "204": + description: import canceled successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: cancel ongoing import + tags: + - import + x-accepts: application/json + get: + operationId: importStatus + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: Unique identifier of the import process + explode: true + in: query + name: id + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportStatus' + description: import status + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get import status + tags: + - import + x-accepts: application/json + post: + operationId: importStart + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImportCreation' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportCreationResponse' + description: Import started + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: import data from object store + tags: + - import + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/objects/stage_allowed: + get: + operationId: uploadObjectPreflight + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "204": + description: User has permissions to upload this object. This does not guarantee + that the upload will be successful or even possible. It indicates only + the permission at the time of calling this endpoint + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - internal + x-accepts: application/json + /repositories/{repository}/branches/{branch}/objects: + delete: + operationId: deleteObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "204": + description: object deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete object. Missing objects will not return a NotFound error. + tags: + - objects + x-accepts: application/json + post: + operationId: uploadObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + - explode: true + in: query + name: storageClass + required: false + schema: + type: string + style: form + - description: Currently supports only "*" to allow uploading an object only + if one doesn't exist yet + example: '*' + explode: false + in: header + name: If-None-Match + required: false + schema: + pattern: ^\*$ + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + multipart/form-data: + schema: + properties: + content: + description: Only a single file per upload which must be named "content". + format: binary + type: string + type: object + application/octet-stream: + schema: + format: binary + type: string + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStats' + description: object metadata + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - objects + x-validation-exclude-body: true + x-contentType: multipart/form-data + x-accepts: application/json + put: + operationId: stageObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStageCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStats' + description: object metadata + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: stage an object's metadata for the given branch + tags: + - objects + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/objects/delete: + post: + operationId: deleteObjects + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PathList' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectErrorList' + description: Delete objects response + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete objects. Missing objects will not return a NotFound error. + tags: + - objects + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/objects/copy: + post: + operationId: copyObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: destination branch for the copy + explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: destination path relative to the branch + explode: true + in: query + name: dest_path + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectCopyCreation' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStats' + description: Copy object response + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create a copy of an object + tags: + - objects + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/refs/{ref}/objects/stat: + get: + operationId: statObject + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + - explode: true + in: query + name: user_metadata + required: false + schema: + default: true + type: boolean + style: form + - explode: true + in: query + name: presign + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStats' + description: object metadata + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad Request + "410": + description: object gone (but partial metadata may be available) + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get object metadata + tags: + - objects + x-accepts: application/json + /repositories/{repository}/refs/{ref}/objects/underlyingProperties: + get: + operationId: getUnderlyingProperties + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - description: relative to the branch + explode: true + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UnderlyingObjectProperties' + description: object metadata on underlying storage + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get object properties on underlying storage + tags: + - objects + x-accepts: application/json + /repositories/{repository}/refs/{ref}/objects/ls: + get: + operationId: listObjects + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: a reference (could be either a branch or a commit ID) + explode: false + in: path + name: ref + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: user_metadata + required: false + schema: + default: true + type: boolean + style: form + - explode: true + in: query + name: presign + required: false + schema: + type: boolean + style: form + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - description: delimiter used to group common prefixes by + explode: true + in: query + name: delimiter + required: false + schema: + type: string + style: form + - description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectStatsList' + description: object listing + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list objects under a given prefix + tags: + - objects + x-accepts: application/json + /repositories/{repository}/refs/{branch}/symlink: + post: + operationId: createSymlinkFile + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: path to the table data + explode: true + in: query + name: location + required: false + schema: + type: string + style: form + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/StorageURI' + description: location created + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: creates symlink files corresponding to the given directory + tags: + - internal + x-accepts: application/json + /repositories/{repository}/actions/runs: + get: + operationId: listRepositoryRuns + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + - explode: true + in: query + name: branch + required: false + schema: + type: string + style: form + - explode: true + in: query + name: commit + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ActionRunList' + description: list action runs + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list runs + tags: + - actions + x-accepts: application/json + /repositories/{repository}/actions/runs/{run_id}: + get: + operationId: getRun + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: run_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ActionRun' + description: action run result + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get a run + tags: + - actions + x-accepts: application/json + /repositories/{repository}/actions/runs/{run_id}/hooks: + get: + operationId: listRunHooks + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: run_id + required: true + schema: + type: string + style: simple + - description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + - description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HookRunList' + description: list specific run hooks + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list run hooks + tags: + - actions + x-accepts: application/json + /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output: + get: + operationId: getRunHookOutput + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: run_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: hook_run_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: run hook output + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get run hook output + tags: + - actions + x-accepts: application/json + /repositories/{repository}/metadata/meta_range/{meta_range}: + get: + operationId: getMetaRange + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: meta_range + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StorageURI' + description: meta-range URI + headers: + Location: + description: redirect to S3 + explode: false + schema: + type: string + style: simple + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: return URI to a meta-range file + tags: + - metadata + x-accepts: application/json + /repositories/{repository}/metadata/range/{range}: + get: + operationId: getRange + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: range + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StorageURI' + description: range URI + headers: + Location: + description: redirect to S3 + explode: false + schema: + type: string + style: simple + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: return URI to a range file + tags: + - metadata + x-accepts: application/json + /repositories/{repository}/gc/rules/set_allowed: + get: + operationId: setGarbageCollectionRulesPreflight + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "204": + description: User has permissions to set garbage collection rules on this + repository + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - internal + x-accepts: application/json + /repositories/{repository}/gc/rules: + delete: + operationId: delete garbage collection rules + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "204": + description: deleted garbage collection rules successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - retention + x-accepts: application/json + get: + operationId: getGarbageCollectionRules + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GarbageCollectionRules' + description: gc rule list + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - retention + x-accepts: application/json + post: + operationId: set garbage collection rules + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GarbageCollectionRules' + required: true + responses: + "204": + description: set garbage collection rules successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - retention + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/gc/prepare_commits: + post: + operationId: prepareGarbageCollectionCommits + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/GarbageCollectionPrepareResponse' + description: paths to commit dataset + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: save lists of active commits for garbage collection + tags: + - retention + x-accepts: application/json + /repositories/{repository}/gc/prepare_uncommited: + post: + operationId: prepareGarbageCollectionUncommitted + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PrepareGCUncommittedRequest' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/PrepareGCUncommittedResponse' + description: paths to commit dataset + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: save repository uncommitted metadata for garbage collection + tags: + - retention + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/branch_protection/set_allowed: + get: + operationId: createBranchProtectionRulePreflight + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "204": + description: User has permissions to create a branch protection rule in + this repository + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - internal + x-accepts: application/json + /repositories/{repository}/branch_protection: + delete: + operationId: deleteBranchProtectionRule + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + application/json: + schema: + properties: + pattern: + type: string + required: + - pattern + type: object + required: true + responses: + "204": + description: branch protection rule deleted successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - repositories + x-contentType: application/json + x-accepts: application/json + get: + operationId: getBranchProtectionRules + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/BranchProtectionRule' + type: array + description: branch protection rules + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get branch protection rules + tags: + - repositories + x-accepts: application/json + post: + operationId: createBranchProtectionRule + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BranchProtectionRule' + required: true + responses: + "204": + description: branch protection rule created successfully + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + tags: + - repositories + x-contentType: application/json + x-accepts: application/json + /healthcheck: + get: + description: check that the API server is up and running + operationId: healthCheck + responses: + "204": + description: NoContent + security: [] + tags: + - healthCheck + x-accepts: application/json + /config/version: + get: + description: get version of lakeFS server + operationId: getLakeFSVersion + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VersionConfig' + description: lakeFS version + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + tags: + - config + x-accepts: application/json + /config/storage: + get: + description: retrieve lakeFS storage configuration + operationId: getStorageConfig + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StorageConfig' + description: lakeFS storage configuration + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + tags: + - config + x-accepts: application/json + /config/garbage-collection: + get: + description: get information of gc settings + operationId: getGarbageCollectionConfig + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GarbageCollectionConfig' + description: lakeFS garbage collection config + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + tags: + - config + x-accepts: application/json + /statistics: + post: + operationId: postStatsEvents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StatsEventsList' + required: true + responses: + "204": + description: reported successfully + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: post stats events, this endpoint is meant for internal use only + tags: + - internal + x-contentType: application/json + x-accepts: application/json +components: + parameters: + PaginationPrefix: + description: return items prefixed with this value + explode: true + in: query + name: prefix + required: false + schema: + type: string + style: form + PaginationAfter: + description: return items after this value + explode: true + in: query + name: after + required: false + schema: + type: string + style: form + PaginationAmount: + description: how many items to return + explode: true + in: query + name: amount + required: false + schema: + default: 100 + maximum: 1000 + minimum: -1 + type: integer + style: form + PaginationDelimiter: + description: delimiter used to group common prefixes by + explode: true + in: query + name: delimiter + required: false + schema: + type: string + style: form + requestBodies: + inline_object_1: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_object_1' + required: true + inline_object: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object' + application/octet-stream: + schema: + $ref: '#/components/schemas/inline_object' + responses: + NotFoundOrNoACL: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorNoACL' + description: Group not found, or group found but has no ACL + Unauthorized: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + ServerError: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + NotFound: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + Conflict: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Conflicts With Target + PreconditionFailed: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed + BadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad Request + Forbidden: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + ValidationError: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + schemas: + Pagination: + example: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + properties: + has_more: + description: Next page is available + type: boolean + next_offset: + description: Token used to retrieve the next page + type: string + results: + description: Number of values found in the results + minimum: 0 + type: integer + max_per_page: + description: Maximal number of entries per page + minimum: 0 + type: integer + required: + - has_more + - max_per_page + - next_offset + - results + type: object + Repository: + example: + default_branch: default_branch + id: id + creation_date: 0 + storage_namespace: storage_namespace + properties: + id: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + default_branch: + type: string + storage_namespace: + description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") + type: string + required: + - creation_date + - default_branch + - id + - storage_namespace + type: object + RepositoryMetadata: + additionalProperties: + type: string + type: object + RepositoryList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - default_branch: default_branch + id: id + creation_date: 0 + storage_namespace: storage_namespace + - default_branch: default_branch + id: id + creation_date: 0 + storage_namespace: storage_namespace + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Repository' + type: array + required: + - pagination + - results + type: object + FindMergeBaseResult: + example: + destination_commit_id: destination_commit_id + base_commit_id: base_commit_id + source_commit_id: source_commit_id + properties: + source_commit_id: + description: The commit ID of the merge source + type: string + destination_commit_id: + description: The commit ID of the merge destination + type: string + base_commit_id: + description: The commit ID of the merge base + type: string + required: + - base_commit_id + - destination_commit_id + - source_commit_id + type: object + MergeResult: + example: + reference: reference + properties: + reference: + type: string + required: + - reference + type: object + RepositoryCreation: + example: + sample_data: true + name: name + default_branch: main + storage_namespace: s3://example-bucket/ + properties: + name: + pattern: ^[a-z0-9][a-z0-9-]{2,62}$ + type: string + storage_namespace: + description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") + example: s3://example-bucket/ + pattern: ^(s3|gs|https?|mem|local|transient)://.*$ + type: string + default_branch: + example: main + type: string + sample_data: + default: false + example: true + type: boolean + required: + - name + - storage_namespace + type: object + PathList: + example: + paths: + - paths + - paths + properties: + paths: + items: + description: Object path + type: string + type: array + required: + - paths + type: object + ObjectStats: + example: + physical_address: physical_address + path: path + metadata: + key: metadata + size_bytes: 6 + content_type: content_type + physical_address_expiry: 0 + checksum: checksum + path_type: common_prefix + mtime: 1 + properties: + path: + type: string + path_type: + enum: + - common_prefix + - object + type: string + physical_address: + description: | + The location of the object on the underlying object store. + Formatted as a native URI with the object store type as scheme ("s3://...", "gs://...", etc.) + Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET + type: string + physical_address_expiry: + description: | + If present and nonzero, physical_address is a pre-signed URL and + will expire at this Unix Epoch time. This will be shorter than + the pre-signed URL lifetime if an authentication token is about + to expire. + + This field is *optional*. + format: int64 + type: integer + checksum: + type: string + size_bytes: + format: int64 + type: integer + mtime: + description: Unix Epoch in seconds + format: int64 + type: integer + metadata: + additionalProperties: + type: string + type: object + content_type: + description: Object media type + type: string + required: + - checksum + - mtime + - path + - path_type + - physical_address + type: object + ObjectStatsList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - physical_address: physical_address + path: path + metadata: + key: metadata + size_bytes: 6 + content_type: content_type + physical_address_expiry: 0 + checksum: checksum + path_type: common_prefix + mtime: 1 + - physical_address: physical_address + path: path + metadata: + key: metadata + size_bytes: 6 + content_type: content_type + physical_address_expiry: 0 + checksum: checksum + path_type: common_prefix + mtime: 1 + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/ObjectStats' + type: array + required: + - pagination + - results + type: object + ObjectCopyCreation: + example: + src_path: src_path + src_ref: src_ref + properties: + src_path: + description: path of the copied object relative to the ref + type: string + src_ref: + description: a reference, if empty uses the provided branch as ref + type: string + required: + - src_path + type: object + ObjectStageCreation: + example: + physical_address: physical_address + metadata: + key: metadata + size_bytes: 0 + content_type: content_type + checksum: checksum + mtime: 6 + properties: + physical_address: + type: string + checksum: + type: string + size_bytes: + format: int64 + type: integer + mtime: + description: Unix Epoch in seconds + format: int64 + type: integer + metadata: + additionalProperties: + type: string + type: object + content_type: + description: Object media type + type: string + required: + - checksum + - physical_address + - size_bytes + type: object + ObjectUserMetadata: + additionalProperties: + type: string + type: object + UnderlyingObjectProperties: + example: + storage_class: storage_class + properties: + storage_class: + nullable: true + type: string + type: object + Ref: + example: + id: id + commit_id: commit_id + properties: + id: + type: string + commit_id: + type: string + required: + - commit_id + - id + type: object + RefList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - id: id + commit_id: commit_id + - id: id + commit_id: commit_id + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Ref' + type: array + required: + - pagination + - results + type: object + Diff: + example: + path: path + size_bytes: 0 + path_type: common_prefix + type: added + properties: + type: + enum: + - added + - removed + - changed + - conflict + - prefix_changed + type: string + path: + type: string + path_type: + enum: + - common_prefix + - object + type: string + size_bytes: + description: represents the size of the added/changed/deleted entry + format: int64 + type: integer + required: + - path + - path_type + - type + type: object + DiffList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - path: path + size_bytes: 0 + path_type: common_prefix + type: added + - path: path + size_bytes: 0 + path_type: common_prefix + type: added + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Diff' + type: array + required: + - pagination + - results + type: object + OtfDiffEntry: + example: + operation_content: '{}' + operation_type: create + id: id + operation: operation + timestamp: 0 + properties: + id: + type: string + timestamp: + type: integer + operation: + type: string + operation_content: + description: free form content describing the returned operation diff + type: object + operation_type: + description: the operation category (CUD) + enum: + - create + - update + - delete + type: string + required: + - id + - operation + - operation_content + - operation_type + - timestamp + type: object + OtfDiffList: + example: + diff_type: created + results: + - operation_content: '{}' + operation_type: create + id: id + operation: operation + timestamp: 0 + - operation_content: '{}' + operation_type: create + id: id + operation: operation + timestamp: 0 + properties: + diff_type: + enum: + - created + - dropped + - changed + type: string + results: + items: + $ref: '#/components/schemas/OtfDiffEntry' + type: array + required: + - results + type: object + DiffProperties: + example: + name: name + properties: + name: + type: string + required: + - name + type: object + OTFDiffs: + example: + diffs: + - name: name + - name: name + properties: + diffs: + items: + $ref: '#/components/schemas/DiffProperties' + type: array + title: A list of available Output Table Format diffs. + type: object + ResetCreation: + example: + path: path + type: object + properties: + type: + enum: + - object + - common_prefix + - reset + type: string + path: + type: string + required: + - type + type: object + RevertCreation: + example: + ref: ref + parent_number: 0 + properties: + ref: + description: the commit to revert, given by a ref + type: string + parent_number: + description: when reverting a merge commit, the parent number (starting + from 1) relative to which to perform the revert. + type: integer + required: + - parent_number + - ref + type: object + CherryPickCreation: + example: + ref: ref + parent_number: 0 + properties: + ref: + description: the commit to cherry-pick, given by a ref + type: string + parent_number: + description: | + when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. + The destination branch is parent 1, which is the default behaviour. + type: integer + required: + - ref + type: object + Commit: + example: + metadata: + key: metadata + committer: committer + id: id + creation_date: 0 + meta_range_id: meta_range_id + message: message + parents: + - parents + - parents + properties: + id: + type: string + parents: + items: + type: string + type: array + committer: + type: string + message: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + meta_range_id: + type: string + metadata: + additionalProperties: + type: string + type: object + required: + - committer + - creation_date + - id + - message + - meta_range_id + - parents + type: object + CommitList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - metadata: + key: metadata + committer: committer + id: id + creation_date: 0 + meta_range_id: meta_range_id + message: message + parents: + - parents + - parents + - metadata: + key: metadata + committer: committer + id: id + creation_date: 0 + meta_range_id: meta_range_id + message: message + parents: + - parents + - parents + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Commit' + type: array + required: + - pagination + - results + type: object + CommitCreation: + example: + date: 0 + metadata: + key: metadata + message: message + properties: + message: + type: string + metadata: + additionalProperties: + type: string + type: object + date: + description: set date to override creation date in the commit (Unix Epoch + in seconds) + format: int64 + type: integer + required: + - message + type: object + Merge: + example: + metadata: + key: metadata + message: message + strategy: strategy + properties: + message: + type: string + metadata: + additionalProperties: + type: string + type: object + strategy: + description: In case of a merge conflict, this option will force the merge + process to automatically favor changes from the dest branch ('dest-wins') + or from the source branch('source-wins'). In case no selection is made, + the merge process will fail in case of a conflict + type: string + type: object + BranchCreation: + example: + name: name + source: source + properties: + name: + type: string + source: + type: string + required: + - name + - source + type: object + TagCreation: + example: + ref: ref + id: id + properties: + id: + type: string + ref: + type: string + required: + - id + - ref + type: object + RefsDump: + example: + tags_meta_range_id: tags_meta_range_id + branches_meta_range_id: branches_meta_range_id + commits_meta_range_id: commits_meta_range_id + properties: + commits_meta_range_id: + type: string + tags_meta_range_id: + type: string + branches_meta_range_id: + type: string + required: + - branches_meta_range_id + - commits_meta_range_id + - tags_meta_range_id + type: object + StorageURI: + description: URI to a path in a storage provider (e.g. "s3://bucket1/path/to/object") + example: + location: location + properties: + location: + type: string + required: + - location + type: object + Error: + example: + message: message + properties: + message: + description: short message explaining the error + type: string + required: + - message + type: object + ObjectError: + example: + path: path + status_code: 0 + message: message + properties: + status_code: + description: HTTP status code associated for operation on path + type: integer + message: + description: short message explaining status_code + type: string + path: + description: affected path + type: string + required: + - message + - status_code + type: object + ObjectErrorList: + example: + errors: + - path: path + status_code: 0 + message: message + - path: path + status_code: 0 + message: message + properties: + errors: + items: + $ref: '#/components/schemas/ObjectError' + type: array + required: + - errors + type: object + ErrorNoACL: + properties: + message: + description: short message explaining the error + type: string + no_acl: + description: true if the group exists but has no ACL + type: boolean + required: + - message + type: object + User: + example: + friendly_name: friendly_name + id: id + creation_date: 0 + properties: + id: + description: a unique identifier for the user. + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + friendly_name: + type: string + required: + - creation_date + - id + type: object + CurrentUser: + example: + user: + friendly_name: friendly_name + id: id + creation_date: 0 + properties: + user: + $ref: '#/components/schemas/User' + required: + - user + type: object + UserCreation: + example: + invite_user: true + id: id + properties: + id: + description: a unique identifier for the user. + type: string + invite_user: + type: boolean + required: + - id + type: object + LoginConfig: + example: + login_failed_message: login_failed_message + logout_url: logout_url + login_url: login_url + RBAC: simplified + fallback_login_url: fallback_login_url + login_cookie_names: + - login_cookie_names + - login_cookie_names + fallback_login_label: fallback_login_label + properties: + RBAC: + description: | + RBAC will remain enabled on GUI if "external". That only works + with an external auth service. + enum: + - simplified + - external + type: string + login_url: + description: primary URL to use for login. + type: string + login_failed_message: + description: | + message to display to users who fail to login; a full sentence that is rendered + in HTML and may contain a link to a secondary login method + type: string + fallback_login_url: + description: secondary URL to offer users to use for login. + type: string + fallback_login_label: + description: label to place on fallback_login_url. + type: string + login_cookie_names: + description: cookie names used to store JWT + items: + type: string + type: array + logout_url: + description: URL to use for logging out. + type: string + required: + - login_cookie_names + - login_url + - logout_url + type: object + SetupState: + example: + login_config: + login_failed_message: login_failed_message + logout_url: logout_url + login_url: login_url + RBAC: simplified + fallback_login_url: fallback_login_url + login_cookie_names: + - login_cookie_names + - login_cookie_names + fallback_login_label: fallback_login_label + state: initialized + comm_prefs_missing: true + properties: + state: + enum: + - initialized + - not_initialized + type: string + comm_prefs_missing: + description: true if the comm prefs are missing. + type: boolean + login_config: + $ref: '#/components/schemas/LoginConfig' + type: object + AccessKeyCredentials: + example: + access_key_id: AKIAIOSFODNN7EXAMPLE + secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + properties: + access_key_id: + description: access key ID to set for user for use in integration testing. + example: AKIAIOSFODNN7EXAMPLE + minLength: 1 + type: string + secret_access_key: + description: secret access key to set for user for use in integration testing. + example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + minLength: 1 + type: string + required: + - access_key_id + - secret_access_key + type: object + Setup: + example: + key: + access_key_id: AKIAIOSFODNN7EXAMPLE + secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + username: username + properties: + username: + description: an identifier for the user (e.g. jane.doe) + type: string + key: + $ref: '#/components/schemas/AccessKeyCredentials' + required: + - username + type: object + CommPrefsInput: + example: + featureUpdates: true + email: email + securityUpdates: true + properties: + email: + description: the provided email + type: string + featureUpdates: + description: was "feature updates" checked + type: boolean + securityUpdates: + description: was "security updates" checked + type: boolean + required: + - featureUpdates + - securityUpdates + type: object + Credentials: + example: + access_key_id: access_key_id + creation_date: 0 + properties: + access_key_id: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + required: + - access_key_id + - creation_date + type: object + CredentialsList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - access_key_id: access_key_id + creation_date: 0 + - access_key_id: access_key_id + creation_date: 0 + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Credentials' + type: array + required: + - pagination + - results + type: object + CredentialsWithSecret: + example: + access_key_id: access_key_id + secret_access_key: secret_access_key + creation_date: 0 + properties: + access_key_id: + type: string + secret_access_key: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + required: + - access_key_id + - creation_date + - secret_access_key + type: object + Group: + example: + id: id + creation_date: 0 + properties: + id: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + required: + - creation_date + - id + type: object + GroupList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - id: id + creation_date: 0 + - id: id + creation_date: 0 + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Group' + type: array + required: + - pagination + - results + type: object + AuthCapabilities: + example: + invite_user: true + forgot_password: true + properties: + invite_user: + type: boolean + forgot_password: + type: boolean + type: object + UserList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - friendly_name: friendly_name + id: id + creation_date: 0 + - friendly_name: friendly_name + id: id + creation_date: 0 + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/User' + type: array + required: + - pagination + - results + type: object + LoginInformation: + example: + access_key_id: access_key_id + secret_access_key: secret_access_key + properties: + access_key_id: + type: string + secret_access_key: + type: string + required: + - access_key_id + - secret_access_key + type: object + AuthenticationToken: + example: + token_expiration: 0 + token: token + properties: + token: + description: a JWT token that could be used to authenticate requests + type: string + token_expiration: + description: Unix Epoch in seconds + format: int64 + type: integer + required: + - token + type: object + GroupCreation: + example: + id: id + properties: + id: + type: string + required: + - id + type: object + Statement: + example: + resource: resource + effect: allow + action: + - action + - action + properties: + effect: + enum: + - allow + - deny + type: string + resource: + type: string + action: + items: + type: string + minItems: 1 + type: array + required: + - action + - effect + - resource + type: object + Policy: + example: + statement: + - resource: resource + effect: allow + action: + - action + - action + - resource: resource + effect: allow + action: + - action + - action + id: id + creation_date: 0 + properties: + id: + type: string + creation_date: + description: Unix Epoch in seconds + format: int64 + type: integer + statement: + items: + $ref: '#/components/schemas/Statement' + minItems: 1 + type: array + required: + - id + - statement + type: object + PolicyList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - statement: + - resource: resource + effect: allow + action: + - action + - action + - resource: resource + effect: allow + action: + - action + - action + id: id + creation_date: 0 + - statement: + - resource: resource + effect: allow + action: + - action + - action + - resource: resource + effect: allow + action: + - action + - action + id: id + creation_date: 0 + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/Policy' + type: array + required: + - pagination + - results + type: object + ACL: + example: + permission: permission + properties: + permission: + description: | + Permission level to give this ACL. "Read", "Write", "Super" and + "Admin" are all supported. + type: string + required: + - permission + type: object + StorageConfig: + example: + blockstore_namespace_example: blockstore_namespace_example + blockstore_namespace_ValidityRegex: blockstore_namespace_ValidityRegex + blockstore_type: blockstore_type + pre_sign_support_ui: true + import_support: true + import_validity_regex: import_validity_regex + default_namespace_prefix: default_namespace_prefix + pre_sign_support: true + properties: + blockstore_type: + type: string + blockstore_namespace_example: + type: string + blockstore_namespace_ValidityRegex: + type: string + default_namespace_prefix: + type: string + pre_sign_support: + type: boolean + pre_sign_support_ui: + type: boolean + import_support: + type: boolean + import_validity_regex: + type: string + required: + - blockstore_namespace_ValidityRegex + - blockstore_namespace_example + - blockstore_type + - import_support + - import_validity_regex + - pre_sign_support + - pre_sign_support_ui + type: object + VersionConfig: + example: + latest_version: latest_version + version: version + upgrade_recommended: true + upgrade_url: upgrade_url + properties: + version: + type: string + latest_version: + type: string + upgrade_recommended: + type: boolean + upgrade_url: + type: string + type: object + GarbageCollectionConfig: + example: + grace_period: 0 + properties: + grace_period: + description: Duration in seconds. Objects created in the recent grace_period + will not be collected. + type: integer + type: object + ActionRun: + example: + start_time: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + event_type: event_type + end_time: 2000-01-23T04:56:07.000+00:00 + branch: branch + commit_id: commit_id + status: failed + properties: + run_id: + type: string + branch: + type: string + start_time: + format: date-time + type: string + end_time: + format: date-time + type: string + event_type: + type: string + status: + enum: + - failed + - completed + type: string + commit_id: + type: string + required: + - branch + - commit_id + - event_type + - run_id + - start_time + - status + type: object + ActionRunList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - start_time: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + event_type: event_type + end_time: 2000-01-23T04:56:07.000+00:00 + branch: branch + commit_id: commit_id + status: failed + - start_time: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + event_type: event_type + end_time: 2000-01-23T04:56:07.000+00:00 + branch: branch + commit_id: commit_id + status: failed + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/ActionRun' + type: array + required: + - pagination + - results + type: object + HookRun: + example: + start_time: 2000-01-23T04:56:07.000+00:00 + hook_id: hook_id + end_time: 2000-01-23T04:56:07.000+00:00 + action: action + hook_run_id: hook_run_id + status: failed + properties: + hook_run_id: + type: string + action: + type: string + hook_id: + type: string + start_time: + format: date-time + type: string + end_time: + format: date-time + type: string + status: + enum: + - failed + - completed + type: string + required: + - action + - hook_id + - hook_run_id + - start_time + - status + type: object + HookRunList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - start_time: 2000-01-23T04:56:07.000+00:00 + hook_id: hook_id + end_time: 2000-01-23T04:56:07.000+00:00 + action: action + hook_run_id: hook_run_id + status: failed + - start_time: 2000-01-23T04:56:07.000+00:00 + hook_id: hook_id + end_time: 2000-01-23T04:56:07.000+00:00 + action: action + hook_run_id: hook_run_id + status: failed + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/HookRun' + type: array + required: + - pagination + - results + type: object + StagingLocation: + description: location for placing an object when staging it + example: + physical_address: physical_address + presigned_url: presigned_url + presigned_url_expiry: 0 + token: token + properties: + physical_address: + type: string + token: + description: opaque staging token to use to link uploaded object + type: string + presigned_url: + description: if presign=true is passed in the request, this field will contain + a pre-signed URL to use when uploading + nullable: true + type: string + presigned_url_expiry: + description: | + If present and nonzero, physical_address is a pre-signed URL and + will expire at this Unix Epoch time. This will be shorter than + the pre-signed URL lifetime if an authentication token is about + to expire. + + This field is *optional*. + format: int64 + type: integer + required: + - token + type: object + StagingMetadata: + description: information about uploaded object + example: + size_bytes: 0 + user_metadata: + key: user_metadata + content_type: content_type + checksum: checksum + staging: + physical_address: physical_address + presigned_url: presigned_url + presigned_url_expiry: 0 + token: token + properties: + staging: + $ref: '#/components/schemas/StagingLocation' + checksum: + description: unique identifier of object content on backing store (typically + ETag) + type: string + size_bytes: + format: int64 + type: integer + user_metadata: + additionalProperties: + type: string + type: object + content_type: + description: Object media type + type: string + required: + - checksum + - size_bytes + - staging + type: object + GarbageCollectionPrepareResponse: + example: + run_id: 64eaa103-d726-4a33-bcb8-7c0b4abfe09e + gc_addresses_location: s3://my-storage-namespace/_lakefs/retention/addresses + gc_commits_location: s3://my-storage-namespace/_lakefs/retention/commits + gc_commits_presigned_url: gc_commits_presigned_url + properties: + run_id: + description: a unique identifier generated for this GC job + example: 64eaa103-d726-4a33-bcb8-7c0b4abfe09e + type: string + gc_commits_location: + description: location of the resulting commits csv table (partitioned by + run_id) + example: s3://my-storage-namespace/_lakefs/retention/commits + type: string + gc_addresses_location: + description: location to use for expired addresses parquet table (partitioned + by run_id) + example: s3://my-storage-namespace/_lakefs/retention/addresses + type: string + gc_commits_presigned_url: + description: a presigned url to download the commits csv + type: string + required: + - gc_addresses_location + - gc_commits_location + - run_id + type: object + PrepareGCUncommittedRequest: + example: + continuation_token: continuation_token + properties: + continuation_token: + type: string + type: object + PrepareGCUncommittedResponse: + example: + continuation_token: continuation_token + run_id: run_id + gc_uncommitted_location: gc_uncommitted_location + properties: + run_id: + type: string + gc_uncommitted_location: + description: location of uncommitted information data + type: string + continuation_token: + type: string + required: + - gc_uncommitted_location + - run_id + type: object + GarbageCollectionRule: + example: + branch_id: branch_id + retention_days: 6 + properties: + branch_id: + type: string + retention_days: + type: integer + required: + - branch_id + - retention_days + type: object + GarbageCollectionRules: + example: + branches: + - branch_id: branch_id + retention_days: 6 + - branch_id: branch_id + retention_days: 6 + default_retention_days: 0 + properties: + default_retention_days: + type: integer + branches: + items: + $ref: '#/components/schemas/GarbageCollectionRule' + type: array + required: + - branches + - default_retention_days + type: object + BranchProtectionRule: + example: + pattern: stable_* + properties: + pattern: + description: fnmatch pattern for the branch name, supporting * and ? wildcards + example: stable_* + minLength: 1 + type: string + required: + - pattern + type: object + ImportLocation: + properties: + type: + description: Path type, can either be 'common_prefix' or 'object' + enum: + - common_prefix + - object + type: string + path: + description: A source location to import path or to a single object. Must + match the lakeFS installation blockstore type. + example: s3://my-bucket/production/collections/ + type: string + destination: + description: Destination for the imported objects on the branch + example: collections/ + type: string + required: + - destination + - path + - type + type: object + ImportCreation: + example: + paths: + - path: s3://my-bucket/production/collections/ + destination: collections/ + type: common_prefix + - path: s3://my-bucket/production/collections/file1 + destination: collections/file1 + type: object + properties: + paths: + items: + $ref: '#/components/schemas/ImportLocation' + type: array + commit: + $ref: '#/components/schemas/CommitCreation' + required: + - commit + - paths + type: object + RangeMetadata: + properties: + id: + description: ID of the range. + example: 480e19972a6fbe98ab8e81ae5efdfd1a29037587e91244e87abd4adefffdb01c + type: string + min_key: + description: First key in the range. + example: production/collections/some/file_1.parquet + type: string + max_key: + description: Last key in the range. + example: production/collections/some/file_8229.parquet + type: string + count: + description: Number of records in the range. + type: integer + estimated_size: + description: Estimated size of the range in bytes + type: integer + required: + - count + - estimated_size + - id + - max_key + - min_key + type: object + ImportStatus: + example: + update_time: 2000-01-23T04:56:07.000+00:00 + metarange_id: metarange_id + ingested_objects: 0 + commit: + metadata: + key: metadata + committer: committer + id: id + creation_date: 0 + meta_range_id: meta_range_id + message: message + parents: + - parents + - parents + completed: true + error: + message: message + properties: + completed: + type: boolean + update_time: + format: date-time + type: string + ingested_objects: + description: Number of objects processed so far + format: int64 + type: integer + metarange_id: + type: string + commit: + $ref: '#/components/schemas/Commit' + error: + $ref: '#/components/schemas/Error' + required: + - completed + - update_time + type: object + ImportCreationResponse: + example: + id: id + properties: + id: + description: The id of the import process + type: string + required: + - id + type: object + MetaRangeCreation: + properties: + ranges: + items: + $ref: '#/components/schemas/RangeMetadata' + minItems: 1 + type: array + required: + - ranges + type: object + MetaRangeCreationResponse: + properties: + id: + description: The id of the created metarange + type: string + type: object + UpdateToken: + properties: + staging_token: + type: string + required: + - staging_token + type: object + StatsEvent: + example: + name: name + count: 0 + class: class + properties: + class: + description: stats event class (e.g. "s3_gateway", "openapi_request", "experimental-feature", + "ui-event") + type: string + name: + description: stats event name (e.g. "put_object", "create_repository", "") + type: string + count: + description: number of events of the class and name + type: integer + required: + - class + - count + - name + type: object + StatsEventsList: + example: + events: + - name: name + count: 0 + class: class + - name: name + count: 0 + class: class + properties: + events: + items: + $ref: '#/components/schemas/StatsEvent' + type: array + required: + - events + type: object + inline_object: + properties: + content: + description: Only a single file per upload which must be named "content". + format: binary + type: string + type: object + inline_object_1: + properties: + pattern: + type: string + required: + - pattern + type: object + securitySchemes: + basic_auth: + scheme: basic + type: http + jwt_token: + bearerFormat: JWT + scheme: bearer + type: http + cookie_auth: + in: cookie + name: internal_auth_session + type: apiKey + oidc_auth: + in: cookie + name: oidc_auth_session + type: apiKey + saml_auth: + in: cookie + name: saml_auth_session + type: apiKey + diff --git a/clients/java-legacy/build.gradle b/clients/java-legacy/build.gradle new file mode 100644 index 00000000000..ffef9fffd9a --- /dev/null +++ b/clients/java-legacy/build.gradle @@ -0,0 +1,123 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' + +group = 'io.lakefs' +version = '0.1.0-SNAPSHOT' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'api-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.5.24' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' + implementation 'com.google.code.gson:gson:2.8.6' + implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation 'org.threeten:threetenbp:1.4.3' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'junit:junit:4.13.1' + testImplementation 'org.mockito:mockito-core:3.11.2' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/clients/java-legacy/build.sbt b/clients/java-legacy/build.sbt new file mode 100644 index 00000000000..c2bb424c99d --- /dev/null +++ b/clients/java-legacy/build.sbt @@ -0,0 +1,26 @@ +lazy val root = (project in file(".")). + settings( + organization := "io.lakefs", + name := "api-client", + version := "0.1.0-SNAPSHOT", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.24", + "com.squareup.okhttp3" % "okhttp" % "4.9.1", + "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", + "com.google.code.gson" % "gson" % "2.8.6", + "org.apache.commons" % "commons-lang3" % "3.10", + "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.threeten" % "threetenbp" % "1.4.3" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "junit" % "junit" % "4.13.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/clients/java-legacy/docs/ACL.md b/clients/java-legacy/docs/ACL.md new file mode 100644 index 00000000000..549df7fe41b --- /dev/null +++ b/clients/java-legacy/docs/ACL.md @@ -0,0 +1,13 @@ + + +# ACL + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permission** | **String** | Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. | + + + diff --git a/clients/java-legacy/docs/AccessKeyCredentials.md b/clients/java-legacy/docs/AccessKeyCredentials.md new file mode 100644 index 00000000000..9cf893ec2e1 --- /dev/null +++ b/clients/java-legacy/docs/AccessKeyCredentials.md @@ -0,0 +1,14 @@ + + +# AccessKeyCredentials + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | access key ID to set for user for use in integration testing. | +**secretAccessKey** | **String** | secret access key to set for user for use in integration testing. | + + + diff --git a/clients/java-legacy/docs/ActionRun.md b/clients/java-legacy/docs/ActionRun.md new file mode 100644 index 00000000000..799b04a9449 --- /dev/null +++ b/clients/java-legacy/docs/ActionRun.md @@ -0,0 +1,28 @@ + + +# ActionRun + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**runId** | **String** | | +**branch** | **String** | | +**startTime** | **OffsetDateTime** | | +**endTime** | **OffsetDateTime** | | [optional] +**eventType** | **String** | | +**status** | [**StatusEnum**](#StatusEnum) | | +**commitId** | **String** | | + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +FAILED | "failed" +COMPLETED | "completed" + + + diff --git a/clients/java-legacy/docs/ActionRunList.md b/clients/java-legacy/docs/ActionRunList.md new file mode 100644 index 00000000000..6e284fd2f39 --- /dev/null +++ b/clients/java-legacy/docs/ActionRunList.md @@ -0,0 +1,14 @@ + + +# ActionRunList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<ActionRun>**](ActionRun.md) | | + + + diff --git a/clients/java-legacy/docs/ActionsApi.md b/clients/java-legacy/docs/ActionsApi.md new file mode 100644 index 00000000000..605ec132a32 --- /dev/null +++ b/clients/java-legacy/docs/ActionsApi.md @@ -0,0 +1,396 @@ +# ActionsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getRun**](ActionsApi.md#getRun) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run +[**getRunHookOutput**](ActionsApi.md#getRunHookOutput) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output +[**listRepositoryRuns**](ActionsApi.md#listRepositoryRuns) | **GET** /repositories/{repository}/actions/runs | list runs +[**listRunHooks**](ActionsApi.md#listRunHooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks + + + +# **getRun** +> ActionRun getRun(repository, runId) + +get a run + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ActionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ActionsApi apiInstance = new ActionsApi(defaultClient); + String repository = "repository_example"; // String | + String runId = "runId_example"; // String | + try { + ActionRun result = apiInstance.getRun(repository, runId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsApi#getRun"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **runId** | **String**| | + +### Return type + +[**ActionRun**](ActionRun.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | action run result | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getRunHookOutput** +> File getRunHookOutput(repository, runId, hookRunId) + +get run hook output + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ActionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ActionsApi apiInstance = new ActionsApi(defaultClient); + String repository = "repository_example"; // String | + String runId = "runId_example"; // String | + String hookRunId = "hookRunId_example"; // String | + try { + File result = apiInstance.getRunHookOutput(repository, runId, hookRunId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsApi#getRunHookOutput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **runId** | **String**| | + **hookRunId** | **String**| | + +### Return type + +[**File**](File.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | run hook output | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listRepositoryRuns** +> ActionRunList listRepositoryRuns(repository, after, amount, branch, commit) + +list runs + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ActionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ActionsApi apiInstance = new ActionsApi(defaultClient); + String repository = "repository_example"; // String | + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + String branch = "branch_example"; // String | + String commit = "commit_example"; // String | + try { + ActionRunList result = apiInstance.listRepositoryRuns(repository, after, amount, branch, commit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsApi#listRepositoryRuns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **branch** | **String**| | [optional] + **commit** | **String**| | [optional] + +### Return type + +[**ActionRunList**](ActionRunList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | list action runs | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listRunHooks** +> HookRunList listRunHooks(repository, runId, after, amount) + +list run hooks + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ActionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ActionsApi apiInstance = new ActionsApi(defaultClient); + String repository = "repository_example"; // String | + String runId = "runId_example"; // String | + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + HookRunList result = apiInstance.listRunHooks(repository, runId, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsApi#listRunHooks"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **runId** | **String**| | + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**HookRunList**](HookRunList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | list specific run hooks | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/AuthApi.md b/clients/java-legacy/docs/AuthApi.md new file mode 100644 index 00000000000..955bdd8a725 --- /dev/null +++ b/clients/java-legacy/docs/AuthApi.md @@ -0,0 +1,2876 @@ +# AuthApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addGroupMembership**](AuthApi.md#addGroupMembership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership +[**attachPolicyToGroup**](AuthApi.md#attachPolicyToGroup) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group +[**attachPolicyToUser**](AuthApi.md#attachPolicyToUser) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user +[**createCredentials**](AuthApi.md#createCredentials) | **POST** /auth/users/{userId}/credentials | create credentials +[**createGroup**](AuthApi.md#createGroup) | **POST** /auth/groups | create group +[**createPolicy**](AuthApi.md#createPolicy) | **POST** /auth/policies | create policy +[**createUser**](AuthApi.md#createUser) | **POST** /auth/users | create user +[**deleteCredentials**](AuthApi.md#deleteCredentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials +[**deleteGroup**](AuthApi.md#deleteGroup) | **DELETE** /auth/groups/{groupId} | delete group +[**deleteGroupMembership**](AuthApi.md#deleteGroupMembership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership +[**deletePolicy**](AuthApi.md#deletePolicy) | **DELETE** /auth/policies/{policyId} | delete policy +[**deleteUser**](AuthApi.md#deleteUser) | **DELETE** /auth/users/{userId} | delete user +[**detachPolicyFromGroup**](AuthApi.md#detachPolicyFromGroup) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group +[**detachPolicyFromUser**](AuthApi.md#detachPolicyFromUser) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user +[**getCredentials**](AuthApi.md#getCredentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials +[**getCurrentUser**](AuthApi.md#getCurrentUser) | **GET** /user | get current user +[**getGroup**](AuthApi.md#getGroup) | **GET** /auth/groups/{groupId} | get group +[**getGroupACL**](AuthApi.md#getGroupACL) | **GET** /auth/groups/{groupId}/acl | get ACL of group +[**getPolicy**](AuthApi.md#getPolicy) | **GET** /auth/policies/{policyId} | get policy +[**getUser**](AuthApi.md#getUser) | **GET** /auth/users/{userId} | get user +[**listGroupMembers**](AuthApi.md#listGroupMembers) | **GET** /auth/groups/{groupId}/members | list group members +[**listGroupPolicies**](AuthApi.md#listGroupPolicies) | **GET** /auth/groups/{groupId}/policies | list group policies +[**listGroups**](AuthApi.md#listGroups) | **GET** /auth/groups | list groups +[**listPolicies**](AuthApi.md#listPolicies) | **GET** /auth/policies | list policies +[**listUserCredentials**](AuthApi.md#listUserCredentials) | **GET** /auth/users/{userId}/credentials | list user credentials +[**listUserGroups**](AuthApi.md#listUserGroups) | **GET** /auth/users/{userId}/groups | list user groups +[**listUserPolicies**](AuthApi.md#listUserPolicies) | **GET** /auth/users/{userId}/policies | list user policies +[**listUsers**](AuthApi.md#listUsers) | **GET** /auth/users | list users +[**login**](AuthApi.md#login) | **POST** /auth/login | perform a login +[**setGroupACL**](AuthApi.md#setGroupACL) | **POST** /auth/groups/{groupId}/acl | set ACL of group +[**updatePolicy**](AuthApi.md#updatePolicy) | **PUT** /auth/policies/{policyId} | update policy + + + +# **addGroupMembership** +> addGroupMembership(groupId, userId) + +add group membership + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String userId = "userId_example"; // String | + try { + apiInstance.addGroupMembership(groupId, userId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#addGroupMembership"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **userId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | membership added successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **attachPolicyToGroup** +> attachPolicyToGroup(groupId, policyId) + +attach policy to group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String policyId = "policyId_example"; // String | + try { + apiInstance.attachPolicyToGroup(groupId, policyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#attachPolicyToGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **policyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | policy attached successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **attachPolicyToUser** +> attachPolicyToUser(userId, policyId) + +attach policy to user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String policyId = "policyId_example"; // String | + try { + apiInstance.attachPolicyToUser(userId, policyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#attachPolicyToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **policyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | policy attached successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **createCredentials** +> CredentialsWithSecret createCredentials(userId) + +create credentials + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + try { + CredentialsWithSecret result = apiInstance.createCredentials(userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#createCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + +### Return type + +[**CredentialsWithSecret**](CredentialsWithSecret.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | credentials | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **createGroup** +> Group createGroup(groupCreation) + +create group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + GroupCreation groupCreation = new GroupCreation(); // GroupCreation | + try { + Group result = apiInstance.createGroup(groupCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#createGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupCreation** | [**GroupCreation**](GroupCreation.md)| | [optional] + +### Return type + +[**Group**](Group.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | group | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **createPolicy** +> Policy createPolicy(policy) + +create policy + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + Policy policy = new Policy(); // Policy | + try { + Policy result = apiInstance.createPolicy(policy); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#createPolicy"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy** | [**Policy**](Policy.md)| | + +### Return type + +[**Policy**](Policy.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | policy | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **createUser** +> User createUser(userCreation) + +create user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + UserCreation userCreation = new UserCreation(); // UserCreation | + try { + User result = apiInstance.createUser(userCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userCreation** | [**UserCreation**](UserCreation.md)| | [optional] + +### Return type + +[**User**](User.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | user | - | +**400** | validation error | - | +**401** | Unauthorized | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **deleteCredentials** +> deleteCredentials(userId, accessKeyId) + +delete credentials + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String accessKeyId = "accessKeyId_example"; // String | + try { + apiInstance.deleteCredentials(userId, accessKeyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#deleteCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **accessKeyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | credentials deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteGroup** +> deleteGroup(groupId) + +delete group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + try { + apiInstance.deleteGroup(groupId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#deleteGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | group deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteGroupMembership** +> deleteGroupMembership(groupId, userId) + +delete group membership + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String userId = "userId_example"; // String | + try { + apiInstance.deleteGroupMembership(groupId, userId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#deleteGroupMembership"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **userId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | membership deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deletePolicy** +> deletePolicy(policyId) + +delete policy + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String policyId = "policyId_example"; // String | + try { + apiInstance.deletePolicy(policyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#deletePolicy"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | policy deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteUser** +> deleteUser(userId) + +delete user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + try { + apiInstance.deleteUser(userId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | user deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **detachPolicyFromGroup** +> detachPolicyFromGroup(groupId, policyId) + +detach policy from group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String policyId = "policyId_example"; // String | + try { + apiInstance.detachPolicyFromGroup(groupId, policyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#detachPolicyFromGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **policyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | policy detached successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **detachPolicyFromUser** +> detachPolicyFromUser(userId, policyId) + +detach policy from user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String policyId = "policyId_example"; // String | + try { + apiInstance.detachPolicyFromUser(userId, policyId); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#detachPolicyFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **policyId** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | policy detached successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getCredentials** +> Credentials getCredentials(userId, accessKeyId) + +get credentials + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String accessKeyId = "accessKeyId_example"; // String | + try { + Credentials result = apiInstance.getCredentials(userId, accessKeyId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **accessKeyId** | **String**| | + +### Return type + +[**Credentials**](Credentials.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | credentials | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getCurrentUser** +> CurrentUser getCurrentUser() + +get current user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + try { + CurrentUser result = apiInstance.getCurrentUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getCurrentUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CurrentUser**](CurrentUser.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | user | - | + + +# **getGroup** +> Group getGroup(groupId) + +get group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + try { + Group result = apiInstance.getGroup(groupId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + +### Return type + +[**Group**](Group.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | group | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getGroupACL** +> ACL getGroupACL(groupId) + +get ACL of group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + try { + ACL result = apiInstance.getGroupACL(groupId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getGroupACL"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + +### Return type + +[**ACL**](ACL.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ACL of group | - | +**401** | Unauthorized | - | +**404** | Group not found, or group found but has no ACL | - | +**0** | Internal Server Error | - | + + +# **getPolicy** +> Policy getPolicy(policyId) + +get policy + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String policyId = "policyId_example"; // String | + try { + Policy result = apiInstance.getPolicy(policyId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getPolicy"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policyId** | **String**| | + +### Return type + +[**Policy**](Policy.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | policy | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getUser** +> User getUser(userId) + +get user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + try { + User result = apiInstance.getUser(userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#getUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + +### Return type + +[**User**](User.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | user | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listGroupMembers** +> UserList listGroupMembers(groupId, prefix, after, amount) + +list group members + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + UserList result = apiInstance.listGroupMembers(groupId, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listGroupMembers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**UserList**](UserList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | group member list | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **listGroupPolicies** +> PolicyList listGroupPolicies(groupId, prefix, after, amount) + +list group policies + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + PolicyList result = apiInstance.listGroupPolicies(groupId, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listGroupPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**PolicyList**](PolicyList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | policy list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listGroups** +> GroupList listGroups(prefix, after, amount) + +list groups + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + GroupList result = apiInstance.listGroups(prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**GroupList**](GroupList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | group list | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **listPolicies** +> PolicyList listPolicies(prefix, after, amount) + +list policies + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + PolicyList result = apiInstance.listPolicies(prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**PolicyList**](PolicyList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | policy list | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **listUserCredentials** +> CredentialsList listUserCredentials(userId, prefix, after, amount) + +list user credentials + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + CredentialsList result = apiInstance.listUserCredentials(userId, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listUserCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**CredentialsList**](CredentialsList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | credential list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listUserGroups** +> GroupList listUserGroups(userId, prefix, after, amount) + +list user groups + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + GroupList result = apiInstance.listUserGroups(userId, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listUserGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**GroupList**](GroupList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | group list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listUserPolicies** +> PolicyList listUserPolicies(userId, prefix, after, amount, effective) + +list user policies + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String userId = "userId_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + Boolean effective = false; // Boolean | will return all distinct policies attached to the user or any of its groups + try { + PolicyList result = apiInstance.listUserPolicies(userId, prefix, after, amount, effective); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listUserPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **effective** | **Boolean**| will return all distinct policies attached to the user or any of its groups | [optional] [default to false] + +### Return type + +[**PolicyList**](PolicyList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | policy list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listUsers** +> UserList listUsers(prefix, after, amount) + +list users + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + UserList result = apiInstance.listUsers(prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#listUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**UserList**](UserList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | user list | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **login** +> AuthenticationToken login(loginInformation) + +perform a login + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + AuthApi apiInstance = new AuthApi(defaultClient); + LoginInformation loginInformation = new LoginInformation(); // LoginInformation | + try { + AuthenticationToken result = apiInstance.login(loginInformation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#login"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginInformation** | [**LoginInformation**](LoginInformation.md)| | [optional] + +### Return type + +[**AuthenticationToken**](AuthenticationToken.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful login | * Set-Cookie -
| +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **setGroupACL** +> setGroupACL(groupId, ACL) + +set ACL of group + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String groupId = "groupId_example"; // String | + ACL ACL = new ACL(); // ACL | + try { + apiInstance.setGroupACL(groupId, ACL); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#setGroupACL"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| | + **ACL** | [**ACL**](ACL.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | ACL successfully changed | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **updatePolicy** +> Policy updatePolicy(policyId, policy) + +update policy + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + AuthApi apiInstance = new AuthApi(defaultClient); + String policyId = "policyId_example"; // String | + Policy policy = new Policy(); // Policy | + try { + Policy result = apiInstance.updatePolicy(policyId, policy); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#updatePolicy"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policyId** | **String**| | + **policy** | [**Policy**](Policy.md)| | + +### Return type + +[**Policy**](Policy.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | policy | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/AuthCapabilities.md b/clients/java-legacy/docs/AuthCapabilities.md new file mode 100644 index 00000000000..664d2ccb8fd --- /dev/null +++ b/clients/java-legacy/docs/AuthCapabilities.md @@ -0,0 +1,14 @@ + + +# AuthCapabilities + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inviteUser** | **Boolean** | | [optional] +**forgotPassword** | **Boolean** | | [optional] + + + diff --git a/clients/java-legacy/docs/AuthenticationToken.md b/clients/java-legacy/docs/AuthenticationToken.md new file mode 100644 index 00000000000..826f4e3c6e5 --- /dev/null +++ b/clients/java-legacy/docs/AuthenticationToken.md @@ -0,0 +1,14 @@ + + +# AuthenticationToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **String** | a JWT token that could be used to authenticate requests | +**tokenExpiration** | **Long** | Unix Epoch in seconds | [optional] + + + diff --git a/clients/java-legacy/docs/BranchCreation.md b/clients/java-legacy/docs/BranchCreation.md new file mode 100644 index 00000000000..7687d5a7422 --- /dev/null +++ b/clients/java-legacy/docs/BranchCreation.md @@ -0,0 +1,14 @@ + + +# BranchCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**source** | **String** | | + + + diff --git a/clients/java-legacy/docs/BranchProtectionRule.md b/clients/java-legacy/docs/BranchProtectionRule.md new file mode 100644 index 00000000000..28153739a93 --- /dev/null +++ b/clients/java-legacy/docs/BranchProtectionRule.md @@ -0,0 +1,13 @@ + + +# BranchProtectionRule + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pattern** | **String** | fnmatch pattern for the branch name, supporting * and ? wildcards | + + + diff --git a/clients/java-legacy/docs/BranchesApi.md b/clients/java-legacy/docs/BranchesApi.md new file mode 100644 index 00000000000..ffbbde2ee2a --- /dev/null +++ b/clients/java-legacy/docs/BranchesApi.md @@ -0,0 +1,782 @@ +# BranchesApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Replay the changes from the given commit on the branch +[**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch +[**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch +[**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch +[**getBranch**](BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch +[**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches +[**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch +[**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert + + + +# **cherryPick** +> Commit cherryPick(repository, branch, cherryPickCreation) + +Replay the changes from the given commit on the branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + CherryPickCreation cherryPickCreation = new CherryPickCreation(); // CherryPickCreation | + try { + Commit result = apiInstance.cherryPick(repository, branch, cherryPickCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#cherryPick"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | + +### Return type + +[**Commit**](Commit.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | the cherry-pick commit | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Conflict Found | - | +**0** | Internal Server Error | - | + + +# **createBranch** +> String createBranch(repository, branchCreation) + +create branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + BranchCreation branchCreation = new BranchCreation(); // BranchCreation | + try { + String result = apiInstance.createBranch(repository, branchCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#createBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branchCreation** | [**BranchCreation**](BranchCreation.md)| | + +### Return type + +**String** + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | reference | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **deleteBranch** +> deleteBranch(repository, branch) + +delete branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + try { + apiInstance.deleteBranch(repository, branch); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#deleteBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | branch deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **diffBranch** +> DiffList diffBranch(repository, branch, after, amount, prefix, delimiter) + +diff branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + String prefix = "prefix_example"; // String | return items prefixed with this value + String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by + try { + DiffList result = apiInstance.diffBranch(repository, branch, after, amount, prefix, delimiter); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#diffBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **prefix** | **String**| return items prefixed with this value | [optional] + **delimiter** | **String**| delimiter used to group common prefixes by | [optional] + +### Return type + +[**DiffList**](DiffList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | diff of branch uncommitted changes | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getBranch** +> Ref getBranch(repository, branch) + +get branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + try { + Ref result = apiInstance.getBranch(repository, branch); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#getBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + +### Return type + +[**Ref**](Ref.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | branch | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listBranches** +> RefList listBranches(repository, prefix, after, amount) + +list branches + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + RefList result = apiInstance.listBranches(repository, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#listBranches"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**RefList**](RefList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | branch list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **resetBranch** +> resetBranch(repository, branch, resetCreation) + +reset branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + ResetCreation resetCreation = new ResetCreation(); // ResetCreation | + try { + apiInstance.resetBranch(repository, branch, resetCreation); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#resetBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **resetCreation** | [**ResetCreation**](ResetCreation.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | reset successful | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **revertBranch** +> revertBranch(repository, branch, revertCreation) + +revert + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + RevertCreation revertCreation = new RevertCreation(); // RevertCreation | + try { + apiInstance.revertBranch(repository, branch, revertCreation); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#revertBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **revertCreation** | [**RevertCreation**](RevertCreation.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | revert successful | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Conflict Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/CherryPickCreation.md b/clients/java-legacy/docs/CherryPickCreation.md new file mode 100644 index 00000000000..5792d3befed --- /dev/null +++ b/clients/java-legacy/docs/CherryPickCreation.md @@ -0,0 +1,14 @@ + + +# CherryPickCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref** | **String** | the commit to cherry-pick, given by a ref | +**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. The destination branch is parent 1, which is the default behaviour. | [optional] + + + diff --git a/clients/java-legacy/docs/CommPrefsInput.md b/clients/java-legacy/docs/CommPrefsInput.md new file mode 100644 index 00000000000..1802f87fcde --- /dev/null +++ b/clients/java-legacy/docs/CommPrefsInput.md @@ -0,0 +1,15 @@ + + +# CommPrefsInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | the provided email | [optional] +**featureUpdates** | **Boolean** | was \"feature updates\" checked | +**securityUpdates** | **Boolean** | was \"security updates\" checked | + + + diff --git a/clients/java-legacy/docs/Commit.md b/clients/java-legacy/docs/Commit.md new file mode 100644 index 00000000000..02ac970bd9c --- /dev/null +++ b/clients/java-legacy/docs/Commit.md @@ -0,0 +1,19 @@ + + +# Commit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**parents** | **List<String>** | | +**committer** | **String** | | +**message** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | +**metaRangeId** | **String** | | +**metadata** | **Map<String, String>** | | [optional] + + + diff --git a/clients/java-legacy/docs/CommitCreation.md b/clients/java-legacy/docs/CommitCreation.md new file mode 100644 index 00000000000..3556070dbd8 --- /dev/null +++ b/clients/java-legacy/docs/CommitCreation.md @@ -0,0 +1,15 @@ + + +# CommitCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | +**metadata** | **Map<String, String>** | | [optional] +**date** | **Long** | set date to override creation date in the commit (Unix Epoch in seconds) | [optional] + + + diff --git a/clients/java-legacy/docs/CommitList.md b/clients/java-legacy/docs/CommitList.md new file mode 100644 index 00000000000..746bdbad057 --- /dev/null +++ b/clients/java-legacy/docs/CommitList.md @@ -0,0 +1,14 @@ + + +# CommitList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Commit>**](Commit.md) | | + + + diff --git a/clients/java-legacy/docs/CommitsApi.md b/clients/java-legacy/docs/CommitsApi.md new file mode 100644 index 00000000000..ad4a0f3881a --- /dev/null +++ b/clients/java-legacy/docs/CommitsApi.md @@ -0,0 +1,203 @@ +# CommitsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**commit**](CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit +[**getCommit**](CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit + + + +# **commit** +> Commit commit(repository, branch, commitCreation, sourceMetarange) + +create commit + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.CommitsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + CommitsApi apiInstance = new CommitsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + CommitCreation commitCreation = new CommitCreation(); // CommitCreation | + String sourceMetarange = "sourceMetarange_example"; // String | The source metarange to commit. Branch must not have uncommitted changes. + try { + Commit result = apiInstance.commit(repository, branch, commitCreation, sourceMetarange); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CommitsApi#commit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **commitCreation** | [**CommitCreation**](CommitCreation.md)| | + **sourceMetarange** | **String**| The source metarange to commit. Branch must not have uncommitted changes. | [optional] + +### Return type + +[**Commit**](Commit.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | commit | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**412** | Precondition Failed (e.g. a pre-commit hook returned a failure) | - | +**0** | Internal Server Error | - | + + +# **getCommit** +> Commit getCommit(repository, commitId) + +get commit + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.CommitsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + CommitsApi apiInstance = new CommitsApi(defaultClient); + String repository = "repository_example"; // String | + String commitId = "commitId_example"; // String | + try { + Commit result = apiInstance.getCommit(repository, commitId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CommitsApi#getCommit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **commitId** | **String**| | + +### Return type + +[**Commit**](Commit.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | commit | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/ConfigApi.md b/clients/java-legacy/docs/ConfigApi.md new file mode 100644 index 00000000000..db0d43749a8 --- /dev/null +++ b/clients/java-legacy/docs/ConfigApi.md @@ -0,0 +1,272 @@ +# ConfigApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getGarbageCollectionConfig**](ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | +[**getLakeFSVersion**](ConfigApi.md#getLakeFSVersion) | **GET** /config/version | +[**getStorageConfig**](ConfigApi.md#getStorageConfig) | **GET** /config/storage | + + + +# **getGarbageCollectionConfig** +> GarbageCollectionConfig getGarbageCollectionConfig() + + + +get information of gc settings + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ConfigApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ConfigApi apiInstance = new ConfigApi(defaultClient); + try { + GarbageCollectionConfig result = apiInstance.getGarbageCollectionConfig(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigApi#getGarbageCollectionConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GarbageCollectionConfig**](GarbageCollectionConfig.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | lakeFS garbage collection config | - | +**401** | Unauthorized | - | + + +# **getLakeFSVersion** +> VersionConfig getLakeFSVersion() + + + +get version of lakeFS server + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ConfigApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ConfigApi apiInstance = new ConfigApi(defaultClient); + try { + VersionConfig result = apiInstance.getLakeFSVersion(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigApi#getLakeFSVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**VersionConfig**](VersionConfig.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | lakeFS version | - | +**401** | Unauthorized | - | + + +# **getStorageConfig** +> StorageConfig getStorageConfig() + + + +retrieve lakeFS storage configuration + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ConfigApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ConfigApi apiInstance = new ConfigApi(defaultClient); + try { + StorageConfig result = apiInstance.getStorageConfig(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigApi#getStorageConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**StorageConfig**](StorageConfig.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | lakeFS storage configuration | - | +**401** | Unauthorized | - | + diff --git a/clients/java-legacy/docs/Credentials.md b/clients/java-legacy/docs/Credentials.md new file mode 100644 index 00000000000..fe7e7c7cfbd --- /dev/null +++ b/clients/java-legacy/docs/Credentials.md @@ -0,0 +1,14 @@ + + +# Credentials + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | + + + diff --git a/clients/java-legacy/docs/CredentialsList.md b/clients/java-legacy/docs/CredentialsList.md new file mode 100644 index 00000000000..cf87d215c42 --- /dev/null +++ b/clients/java-legacy/docs/CredentialsList.md @@ -0,0 +1,14 @@ + + +# CredentialsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Credentials>**](Credentials.md) | | + + + diff --git a/clients/java-legacy/docs/CredentialsWithSecret.md b/clients/java-legacy/docs/CredentialsWithSecret.md new file mode 100644 index 00000000000..82e9b89c207 --- /dev/null +++ b/clients/java-legacy/docs/CredentialsWithSecret.md @@ -0,0 +1,15 @@ + + +# CredentialsWithSecret + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | | +**secretAccessKey** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | + + + diff --git a/clients/java-legacy/docs/CurrentUser.md b/clients/java-legacy/docs/CurrentUser.md new file mode 100644 index 00000000000..0c0af81ddfe --- /dev/null +++ b/clients/java-legacy/docs/CurrentUser.md @@ -0,0 +1,13 @@ + + +# CurrentUser + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**User**](User.md) | | + + + diff --git a/clients/java-legacy/docs/Diff.md b/clients/java-legacy/docs/Diff.md new file mode 100644 index 00000000000..640d51ba54f --- /dev/null +++ b/clients/java-legacy/docs/Diff.md @@ -0,0 +1,37 @@ + + +# Diff + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**TypeEnum**](#TypeEnum) | | +**path** | **String** | | +**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | +**sizeBytes** | **Long** | represents the size of the added/changed/deleted entry | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +ADDED | "added" +REMOVED | "removed" +CHANGED | "changed" +CONFLICT | "conflict" +PREFIX_CHANGED | "prefix_changed" + + + +## Enum: PathTypeEnum + +Name | Value +---- | ----- +COMMON_PREFIX | "common_prefix" +OBJECT | "object" + + + diff --git a/clients/java-legacy/docs/DiffList.md b/clients/java-legacy/docs/DiffList.md new file mode 100644 index 00000000000..17f99dedfa2 --- /dev/null +++ b/clients/java-legacy/docs/DiffList.md @@ -0,0 +1,14 @@ + + +# DiffList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Diff>**](Diff.md) | | + + + diff --git a/clients/java-legacy/docs/DiffProperties.md b/clients/java-legacy/docs/DiffProperties.md new file mode 100644 index 00000000000..839ef16e6d4 --- /dev/null +++ b/clients/java-legacy/docs/DiffProperties.md @@ -0,0 +1,13 @@ + + +# DiffProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | + + + diff --git a/clients/java-legacy/docs/Error.md b/clients/java-legacy/docs/Error.md new file mode 100644 index 00000000000..996ecb91cbc --- /dev/null +++ b/clients/java-legacy/docs/Error.md @@ -0,0 +1,13 @@ + + +# Error + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | short message explaining the error | + + + diff --git a/clients/java-legacy/docs/ErrorNoACL.md b/clients/java-legacy/docs/ErrorNoACL.md new file mode 100644 index 00000000000..cc0d72f6f35 --- /dev/null +++ b/clients/java-legacy/docs/ErrorNoACL.md @@ -0,0 +1,14 @@ + + +# ErrorNoACL + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | short message explaining the error | +**noAcl** | **Boolean** | true if the group exists but has no ACL | [optional] + + + diff --git a/clients/java-legacy/docs/ExperimentalApi.md b/clients/java-legacy/docs/ExperimentalApi.md new file mode 100644 index 00000000000..4e8e88fac2c --- /dev/null +++ b/clients/java-legacy/docs/ExperimentalApi.md @@ -0,0 +1,196 @@ +# ExperimentalApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getOtfDiffs**](ExperimentalApi.md#getOtfDiffs) | **GET** /otf/diffs | get the available Open Table Format diffs +[**otfDiff**](ExperimentalApi.md#otfDiff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff + + + +# **getOtfDiffs** +> OTFDiffs getOtfDiffs() + +get the available Open Table Format diffs + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ExperimentalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ExperimentalApi apiInstance = new ExperimentalApi(defaultClient); + try { + OTFDiffs result = apiInstance.getOtfDiffs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#getOtfDiffs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OTFDiffs**](OTFDiffs.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | available Open Table Format diffs | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **otfDiff** +> OtfDiffList otfDiff(repository, leftRef, rightRef, tablePath, type) + +perform otf diff + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ExperimentalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ExperimentalApi apiInstance = new ExperimentalApi(defaultClient); + String repository = "repository_example"; // String | + String leftRef = "leftRef_example"; // String | + String rightRef = "rightRef_example"; // String | + String tablePath = "tablePath_example"; // String | a path to the table location under the specified ref. + String type = "type_example"; // String | the type of otf + try { + OtfDiffList result = apiInstance.otfDiff(repository, leftRef, rightRef, tablePath, type); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#otfDiff"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **leftRef** | **String**| | + **rightRef** | **String**| | + **tablePath** | **String**| a path to the table location under the specified ref. | + **type** | **String**| the type of otf | + +### Return type + +[**OtfDiffList**](OtfDiffList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | diff list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**412** | Precondition Failed | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/FindMergeBaseResult.md b/clients/java-legacy/docs/FindMergeBaseResult.md new file mode 100644 index 00000000000..227aeb19c3b --- /dev/null +++ b/clients/java-legacy/docs/FindMergeBaseResult.md @@ -0,0 +1,15 @@ + + +# FindMergeBaseResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceCommitId** | **String** | The commit ID of the merge source | +**destinationCommitId** | **String** | The commit ID of the merge destination | +**baseCommitId** | **String** | The commit ID of the merge base | + + + diff --git a/clients/java-legacy/docs/GarbageCollectionConfig.md b/clients/java-legacy/docs/GarbageCollectionConfig.md new file mode 100644 index 00000000000..bca9ecf343c --- /dev/null +++ b/clients/java-legacy/docs/GarbageCollectionConfig.md @@ -0,0 +1,13 @@ + + +# GarbageCollectionConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**gracePeriod** | **Integer** | Duration in seconds. Objects created in the recent grace_period will not be collected. | [optional] + + + diff --git a/clients/java-legacy/docs/GarbageCollectionPrepareResponse.md b/clients/java-legacy/docs/GarbageCollectionPrepareResponse.md new file mode 100644 index 00000000000..55e53a80dad --- /dev/null +++ b/clients/java-legacy/docs/GarbageCollectionPrepareResponse.md @@ -0,0 +1,16 @@ + + +# GarbageCollectionPrepareResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**runId** | **String** | a unique identifier generated for this GC job | +**gcCommitsLocation** | **String** | location of the resulting commits csv table (partitioned by run_id) | +**gcAddressesLocation** | **String** | location to use for expired addresses parquet table (partitioned by run_id) | +**gcCommitsPresignedUrl** | **String** | a presigned url to download the commits csv | [optional] + + + diff --git a/clients/java-legacy/docs/GarbageCollectionRule.md b/clients/java-legacy/docs/GarbageCollectionRule.md new file mode 100644 index 00000000000..8d71ee5936b --- /dev/null +++ b/clients/java-legacy/docs/GarbageCollectionRule.md @@ -0,0 +1,14 @@ + + +# GarbageCollectionRule + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branchId** | **String** | | +**retentionDays** | **Integer** | | + + + diff --git a/clients/java-legacy/docs/GarbageCollectionRules.md b/clients/java-legacy/docs/GarbageCollectionRules.md new file mode 100644 index 00000000000..47241dd588f --- /dev/null +++ b/clients/java-legacy/docs/GarbageCollectionRules.md @@ -0,0 +1,14 @@ + + +# GarbageCollectionRules + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**defaultRetentionDays** | **Integer** | | +**branches** | [**List<GarbageCollectionRule>**](GarbageCollectionRule.md) | | + + + diff --git a/clients/java-legacy/docs/Group.md b/clients/java-legacy/docs/Group.md new file mode 100644 index 00000000000..c3c0f61f329 --- /dev/null +++ b/clients/java-legacy/docs/Group.md @@ -0,0 +1,14 @@ + + +# Group + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | + + + diff --git a/clients/java-legacy/docs/GroupCreation.md b/clients/java-legacy/docs/GroupCreation.md new file mode 100644 index 00000000000..aa708281470 --- /dev/null +++ b/clients/java-legacy/docs/GroupCreation.md @@ -0,0 +1,13 @@ + + +# GroupCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | + + + diff --git a/clients/java-legacy/docs/GroupList.md b/clients/java-legacy/docs/GroupList.md new file mode 100644 index 00000000000..ec0135a5d27 --- /dev/null +++ b/clients/java-legacy/docs/GroupList.md @@ -0,0 +1,14 @@ + + +# GroupList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Group>**](Group.md) | | + + + diff --git a/clients/java-legacy/docs/HealthCheckApi.md b/clients/java-legacy/docs/HealthCheckApi.md new file mode 100644 index 00000000000..a2fb177f41f --- /dev/null +++ b/clients/java-legacy/docs/HealthCheckApi.md @@ -0,0 +1,66 @@ +# HealthCheckApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**healthCheck**](HealthCheckApi.md#healthCheck) | **GET** /healthcheck | + + + +# **healthCheck** +> healthCheck() + + + +check that the API server is up and running + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.HealthCheckApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + HealthCheckApi apiInstance = new HealthCheckApi(defaultClient); + try { + apiInstance.healthCheck(); + } catch (ApiException e) { + System.err.println("Exception when calling HealthCheckApi#healthCheck"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | NoContent | - | + diff --git a/clients/java-legacy/docs/HookRun.md b/clients/java-legacy/docs/HookRun.md new file mode 100644 index 00000000000..9f046a5a807 --- /dev/null +++ b/clients/java-legacy/docs/HookRun.md @@ -0,0 +1,27 @@ + + +# HookRun + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hookRunId** | **String** | | +**action** | **String** | | +**hookId** | **String** | | +**startTime** | **OffsetDateTime** | | +**endTime** | **OffsetDateTime** | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | | + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +FAILED | "failed" +COMPLETED | "completed" + + + diff --git a/clients/java-legacy/docs/HookRunList.md b/clients/java-legacy/docs/HookRunList.md new file mode 100644 index 00000000000..ee78cfec604 --- /dev/null +++ b/clients/java-legacy/docs/HookRunList.md @@ -0,0 +1,14 @@ + + +# HookRunList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<HookRun>**](HookRun.md) | | + + + diff --git a/clients/java-legacy/docs/ImportApi.md b/clients/java-legacy/docs/ImportApi.md new file mode 100644 index 00000000000..1746e39662f --- /dev/null +++ b/clients/java-legacy/docs/ImportApi.md @@ -0,0 +1,298 @@ +# ImportApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**importCancel**](ImportApi.md#importCancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import +[**importStart**](ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store +[**importStatus**](ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status + + + +# **importCancel** +> importCancel(repository, branch, id) + +cancel ongoing import + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ImportApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ImportApi apiInstance = new ImportApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String id = "id_example"; // String | Unique identifier of the import process + try { + apiInstance.importCancel(repository, branch, id); + } catch (ApiException e) { + System.err.println("Exception when calling ImportApi#importCancel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **id** | **String**| Unique identifier of the import process | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | import canceled successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **importStart** +> ImportCreationResponse importStart(repository, branch, importCreation) + +import data from object store + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ImportApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ImportApi apiInstance = new ImportApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + ImportCreation importCreation = new ImportCreation(); // ImportCreation | + try { + ImportCreationResponse result = apiInstance.importStart(repository, branch, importCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ImportApi#importStart"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **importCreation** | [**ImportCreation**](ImportCreation.md)| | + +### Return type + +[**ImportCreationResponse**](ImportCreationResponse.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Import started | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **importStatus** +> ImportStatus importStatus(repository, branch, id) + +get import status + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ImportApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ImportApi apiInstance = new ImportApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String id = "id_example"; // String | Unique identifier of the import process + try { + ImportStatus result = apiInstance.importStatus(repository, branch, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ImportApi#importStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **id** | **String**| Unique identifier of the import process | + +### Return type + +[**ImportStatus**](ImportStatus.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | import status | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/ImportCreation.md b/clients/java-legacy/docs/ImportCreation.md new file mode 100644 index 00000000000..fe61b88b638 --- /dev/null +++ b/clients/java-legacy/docs/ImportCreation.md @@ -0,0 +1,14 @@ + + +# ImportCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paths** | [**List<ImportLocation>**](ImportLocation.md) | | +**commit** | [**CommitCreation**](CommitCreation.md) | | + + + diff --git a/clients/java-legacy/docs/ImportCreationResponse.md b/clients/java-legacy/docs/ImportCreationResponse.md new file mode 100644 index 00000000000..98b8852d49f --- /dev/null +++ b/clients/java-legacy/docs/ImportCreationResponse.md @@ -0,0 +1,13 @@ + + +# ImportCreationResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The id of the import process | + + + diff --git a/clients/java-legacy/docs/ImportLocation.md b/clients/java-legacy/docs/ImportLocation.md new file mode 100644 index 00000000000..bbea056cd4e --- /dev/null +++ b/clients/java-legacy/docs/ImportLocation.md @@ -0,0 +1,24 @@ + + +# ImportLocation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**TypeEnum**](#TypeEnum) | Path type, can either be 'common_prefix' or 'object' | +**path** | **String** | A source location to import path or to a single object. Must match the lakeFS installation blockstore type. | +**destination** | **String** | Destination for the imported objects on the branch | + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +COMMON_PREFIX | "common_prefix" +OBJECT | "object" + + + diff --git a/clients/java-legacy/docs/ImportStatus.md b/clients/java-legacy/docs/ImportStatus.md new file mode 100644 index 00000000000..e184f352672 --- /dev/null +++ b/clients/java-legacy/docs/ImportStatus.md @@ -0,0 +1,18 @@ + + +# ImportStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed** | **Boolean** | | +**updateTime** | **OffsetDateTime** | | +**ingestedObjects** | **Long** | Number of objects processed so far | [optional] +**metarangeId** | **String** | | [optional] +**commit** | [**Commit**](Commit.md) | | [optional] +**error** | [**Error**](Error.md) | | [optional] + + + diff --git a/clients/java/docs/InlineObject.md b/clients/java-legacy/docs/InlineObject.md similarity index 100% rename from clients/java/docs/InlineObject.md rename to clients/java-legacy/docs/InlineObject.md diff --git a/clients/java/docs/InlineObject1.md b/clients/java-legacy/docs/InlineObject1.md similarity index 100% rename from clients/java/docs/InlineObject1.md rename to clients/java-legacy/docs/InlineObject1.md diff --git a/clients/java-legacy/docs/InternalApi.md b/clients/java-legacy/docs/InternalApi.md new file mode 100644 index 00000000000..3e631593959 --- /dev/null +++ b/clients/java-legacy/docs/InternalApi.md @@ -0,0 +1,717 @@ +# InternalApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBranchProtectionRulePreflight**](InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +[**createSymlinkFile**](InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory +[**getAuthCapabilities**](InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported +[**getSetupState**](InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +[**postStatsEvents**](InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only +[**setGarbageCollectionRulesPreflight**](InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | +[**setup**](InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user +[**setupCommPrefs**](InternalApi.md#setupCommPrefs) | **POST** /setup_comm_prefs | setup communications preferences +[**uploadObjectPreflight**](InternalApi.md#uploadObjectPreflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | + + + +# **createBranchProtectionRulePreflight** +> createBranchProtectionRulePreflight(repository) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + InternalApi apiInstance = new InternalApi(defaultClient); + String repository = "repository_example"; // String | + try { + apiInstance.createBranchProtectionRulePreflight(repository); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#createBranchProtectionRulePreflight"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | User has permissions to create a branch protection rule in this repository | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **createSymlinkFile** +> StorageURI createSymlinkFile(repository, branch, location) + +creates symlink files corresponding to the given directory + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + InternalApi apiInstance = new InternalApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String location = "location_example"; // String | path to the table data + try { + StorageURI result = apiInstance.createSymlinkFile(repository, branch, location); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#createSymlinkFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **location** | **String**| path to the table data | [optional] + +### Return type + +[**StorageURI**](StorageURI.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | location created | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getAuthCapabilities** +> AuthCapabilities getAuthCapabilities() + +list authentication capabilities supported + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + InternalApi apiInstance = new InternalApi(defaultClient); + try { + AuthCapabilities result = apiInstance.getAuthCapabilities(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#getAuthCapabilities"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AuthCapabilities**](AuthCapabilities.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | auth capabilities | - | +**0** | Internal Server Error | - | + + +# **getSetupState** +> SetupState getSetupState() + +check if the lakeFS installation is already set up + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + InternalApi apiInstance = new InternalApi(defaultClient); + try { + SetupState result = apiInstance.getSetupState(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#getSetupState"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**SetupState**](SetupState.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | lakeFS setup state | - | +**0** | Internal Server Error | - | + + +# **postStatsEvents** +> postStatsEvents(statsEventsList) + +post stats events, this endpoint is meant for internal use only + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + InternalApi apiInstance = new InternalApi(defaultClient); + StatsEventsList statsEventsList = new StatsEventsList(); // StatsEventsList | + try { + apiInstance.postStatsEvents(statsEventsList); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#postStatsEvents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **statsEventsList** | [**StatsEventsList**](StatsEventsList.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | reported successfully | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + + +# **setGarbageCollectionRulesPreflight** +> setGarbageCollectionRulesPreflight(repository) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + InternalApi apiInstance = new InternalApi(defaultClient); + String repository = "repository_example"; // String | + try { + apiInstance.setGarbageCollectionRulesPreflight(repository); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#setGarbageCollectionRulesPreflight"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | User has permissions to set garbage collection rules on this repository | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **setup** +> CredentialsWithSecret setup(setup) + +setup lakeFS and create a first user + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + InternalApi apiInstance = new InternalApi(defaultClient); + Setup setup = new Setup(); // Setup | + try { + CredentialsWithSecret result = apiInstance.setup(setup); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#setup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **setup** | [**Setup**](Setup.md)| | + +### Return type + +[**CredentialsWithSecret**](CredentialsWithSecret.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | user created successfully | - | +**400** | Bad Request | - | +**409** | setup was already called | - | +**0** | Internal Server Error | - | + + +# **setupCommPrefs** +> setupCommPrefs(commPrefsInput) + +setup communications preferences + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + InternalApi apiInstance = new InternalApi(defaultClient); + CommPrefsInput commPrefsInput = new CommPrefsInput(); // CommPrefsInput | + try { + apiInstance.setupCommPrefs(commPrefsInput); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#setupCommPrefs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **commPrefsInput** | [**CommPrefsInput**](CommPrefsInput.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | communication preferences saved successfully | - | +**409** | setup was already completed | - | +**412** | wrong setup state for this operation | - | +**0** | Internal Server Error | - | + + +# **uploadObjectPreflight** +> uploadObjectPreflight(repository, branch, path) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.InternalApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + InternalApi apiInstance = new InternalApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + try { + apiInstance.uploadObjectPreflight(repository, branch, path); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#uploadObjectPreflight"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/LoginConfig.md b/clients/java-legacy/docs/LoginConfig.md new file mode 100644 index 00000000000..ee91a722819 --- /dev/null +++ b/clients/java-legacy/docs/LoginConfig.md @@ -0,0 +1,28 @@ + + +# LoginConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RBAC** | [**RBACEnum**](#RBACEnum) | RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. | [optional] +**loginUrl** | **String** | primary URL to use for login. | +**loginFailedMessage** | **String** | message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method | [optional] +**fallbackLoginUrl** | **String** | secondary URL to offer users to use for login. | [optional] +**fallbackLoginLabel** | **String** | label to place on fallback_login_url. | [optional] +**loginCookieNames** | **List<String>** | cookie names used to store JWT | +**logoutUrl** | **String** | URL to use for logging out. | + + + +## Enum: RBACEnum + +Name | Value +---- | ----- +SIMPLIFIED | "simplified" +EXTERNAL | "external" + + + diff --git a/clients/java-legacy/docs/LoginInformation.md b/clients/java-legacy/docs/LoginInformation.md new file mode 100644 index 00000000000..2e7005e504a --- /dev/null +++ b/clients/java-legacy/docs/LoginInformation.md @@ -0,0 +1,14 @@ + + +# LoginInformation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | | +**secretAccessKey** | **String** | | + + + diff --git a/clients/java-legacy/docs/Merge.md b/clients/java-legacy/docs/Merge.md new file mode 100644 index 00000000000..7d295da0bbd --- /dev/null +++ b/clients/java-legacy/docs/Merge.md @@ -0,0 +1,15 @@ + + +# Merge + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] +**metadata** | **Map<String, String>** | | [optional] +**strategy** | **String** | In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict | [optional] + + + diff --git a/clients/java-legacy/docs/MergeResult.md b/clients/java-legacy/docs/MergeResult.md new file mode 100644 index 00000000000..ade30e913af --- /dev/null +++ b/clients/java-legacy/docs/MergeResult.md @@ -0,0 +1,13 @@ + + +# MergeResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reference** | **String** | | + + + diff --git a/clients/java-legacy/docs/MetaRangeCreation.md b/clients/java-legacy/docs/MetaRangeCreation.md new file mode 100644 index 00000000000..c80331077ac --- /dev/null +++ b/clients/java-legacy/docs/MetaRangeCreation.md @@ -0,0 +1,13 @@ + + +# MetaRangeCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ranges** | [**List<RangeMetadata>**](RangeMetadata.md) | | + + + diff --git a/clients/java-legacy/docs/MetaRangeCreationResponse.md b/clients/java-legacy/docs/MetaRangeCreationResponse.md new file mode 100644 index 00000000000..7480032cb74 --- /dev/null +++ b/clients/java-legacy/docs/MetaRangeCreationResponse.md @@ -0,0 +1,13 @@ + + +# MetaRangeCreationResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The id of the created metarange | [optional] + + + diff --git a/clients/java-legacy/docs/MetadataApi.md b/clients/java-legacy/docs/MetadataApi.md new file mode 100644 index 00000000000..f4d70ba1d10 --- /dev/null +++ b/clients/java-legacy/docs/MetadataApi.md @@ -0,0 +1,196 @@ +# MetadataApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getMetaRange**](MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file +[**getRange**](MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file + + + +# **getMetaRange** +> StorageURI getMetaRange(repository, metaRange) + +return URI to a meta-range file + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.MetadataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String repository = "repository_example"; // String | + String metaRange = "metaRange_example"; // String | + try { + StorageURI result = apiInstance.getMetaRange(repository, metaRange); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getMetaRange"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **metaRange** | **String**| | + +### Return type + +[**StorageURI**](StorageURI.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | meta-range URI | * Location - redirect to S3
| +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getRange** +> StorageURI getRange(repository, range) + +return URI to a range file + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.MetadataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String repository = "repository_example"; // String | + String range = "range_example"; // String | + try { + StorageURI result = apiInstance.getRange(repository, range); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getRange"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **range** | **String**| | + +### Return type + +[**StorageURI**](StorageURI.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | range URI | * Location - redirect to S3
| +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/OTFDiffs.md b/clients/java-legacy/docs/OTFDiffs.md new file mode 100644 index 00000000000..decae899d7a --- /dev/null +++ b/clients/java-legacy/docs/OTFDiffs.md @@ -0,0 +1,13 @@ + + +# OTFDiffs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**diffs** | [**List<DiffProperties>**](DiffProperties.md) | | [optional] + + + diff --git a/clients/java-legacy/docs/ObjectCopyCreation.md b/clients/java-legacy/docs/ObjectCopyCreation.md new file mode 100644 index 00000000000..ac3b35ed570 --- /dev/null +++ b/clients/java-legacy/docs/ObjectCopyCreation.md @@ -0,0 +1,14 @@ + + +# ObjectCopyCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**srcPath** | **String** | path of the copied object relative to the ref | +**srcRef** | **String** | a reference, if empty uses the provided branch as ref | [optional] + + + diff --git a/clients/java-legacy/docs/ObjectError.md b/clients/java-legacy/docs/ObjectError.md new file mode 100644 index 00000000000..9f31da2bc2d --- /dev/null +++ b/clients/java-legacy/docs/ObjectError.md @@ -0,0 +1,15 @@ + + +# ObjectError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statusCode** | **Integer** | HTTP status code associated for operation on path | +**message** | **String** | short message explaining status_code | +**path** | **String** | affected path | [optional] + + + diff --git a/clients/java-legacy/docs/ObjectErrorList.md b/clients/java-legacy/docs/ObjectErrorList.md new file mode 100644 index 00000000000..f94202ec3b5 --- /dev/null +++ b/clients/java-legacy/docs/ObjectErrorList.md @@ -0,0 +1,13 @@ + + +# ObjectErrorList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**List<ObjectError>**](ObjectError.md) | | + + + diff --git a/clients/java-legacy/docs/ObjectStageCreation.md b/clients/java-legacy/docs/ObjectStageCreation.md new file mode 100644 index 00000000000..3a0e1cfd15d --- /dev/null +++ b/clients/java-legacy/docs/ObjectStageCreation.md @@ -0,0 +1,18 @@ + + +# ObjectStageCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**physicalAddress** | **String** | | +**checksum** | **String** | | +**sizeBytes** | **Long** | | +**mtime** | **Long** | Unix Epoch in seconds | [optional] +**metadata** | **Map<String, String>** | | [optional] +**contentType** | **String** | Object media type | [optional] + + + diff --git a/clients/java-legacy/docs/ObjectStats.md b/clients/java-legacy/docs/ObjectStats.md new file mode 100644 index 00000000000..ed818768da7 --- /dev/null +++ b/clients/java-legacy/docs/ObjectStats.md @@ -0,0 +1,30 @@ + + +# ObjectStats + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **String** | | +**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | +**physicalAddress** | **String** | The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET | +**physicalAddressExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] +**checksum** | **String** | | +**sizeBytes** | **Long** | | [optional] +**mtime** | **Long** | Unix Epoch in seconds | +**metadata** | **Map<String, String>** | | [optional] +**contentType** | **String** | Object media type | [optional] + + + +## Enum: PathTypeEnum + +Name | Value +---- | ----- +COMMON_PREFIX | "common_prefix" +OBJECT | "object" + + + diff --git a/clients/java-legacy/docs/ObjectStatsList.md b/clients/java-legacy/docs/ObjectStatsList.md new file mode 100644 index 00000000000..7db300499db --- /dev/null +++ b/clients/java-legacy/docs/ObjectStatsList.md @@ -0,0 +1,14 @@ + + +# ObjectStatsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<ObjectStats>**](ObjectStats.md) | | + + + diff --git a/clients/java-legacy/docs/ObjectsApi.md b/clients/java-legacy/docs/ObjectsApi.md new file mode 100644 index 00000000000..a34aebab0d0 --- /dev/null +++ b/clients/java-legacy/docs/ObjectsApi.md @@ -0,0 +1,1013 @@ +# ObjectsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**copyObject**](ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object +[**deleteObject**](ObjectsApi.md#deleteObject) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. +[**deleteObjects**](ObjectsApi.md#deleteObjects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. +[**getObject**](ObjectsApi.md#getObject) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content +[**getUnderlyingProperties**](ObjectsApi.md#getUnderlyingProperties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage +[**headObject**](ObjectsApi.md#headObject) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists +[**listObjects**](ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix +[**stageObject**](ObjectsApi.md#stageObject) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch +[**statObject**](ObjectsApi.md#statObject) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata +[**uploadObject**](ObjectsApi.md#uploadObject) | **POST** /repositories/{repository}/branches/{branch}/objects | + + + +# **copyObject** +> ObjectStats copyObject(repository, branch, destPath, objectCopyCreation) + +create a copy of an object + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | destination branch for the copy + String destPath = "destPath_example"; // String | destination path relative to the branch + ObjectCopyCreation objectCopyCreation = new ObjectCopyCreation(); // ObjectCopyCreation | + try { + ObjectStats result = apiInstance.copyObject(repository, branch, destPath, objectCopyCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#copyObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| destination branch for the copy | + **destPath** | **String**| destination path relative to the branch | + **objectCopyCreation** | [**ObjectCopyCreation**](ObjectCopyCreation.md)| | + +### Return type + +[**ObjectStats**](ObjectStats.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Copy object response | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteObject** +> deleteObject(repository, branch, path) + +delete object. Missing objects will not return a NotFound error. + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + try { + apiInstance.deleteObject(repository, branch, path); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#deleteObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | object deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteObjects** +> ObjectErrorList deleteObjects(repository, branch, pathList) + +delete objects. Missing objects will not return a NotFound error. + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + PathList pathList = new PathList(); // PathList | + try { + ObjectErrorList result = apiInstance.deleteObjects(repository, branch, pathList); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#deleteObjects"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **pathList** | [**PathList**](PathList.md)| | + +### Return type + +[**ObjectErrorList**](ObjectErrorList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Delete objects response | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getObject** +> File getObject(repository, ref, path, range, presign) + +get object content + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) + String path = "path_example"; // String | relative to the ref + String range = "bytes=0-1023"; // String | Byte range to retrieve + Boolean presign = true; // Boolean | + try { + File result = apiInstance.getObject(repository, ref, path, range, presign); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#getObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| a reference (could be either a branch or a commit ID) | + **path** | **String**| relative to the ref | + **range** | **String**| Byte range to retrieve | [optional] + **presign** | **Boolean**| | [optional] + +### Return type + +[**File**](File.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object content | * Content-Length -
* Last-Modified -
* ETag -
| +**206** | partial object content | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| +**302** | Redirect to a pre-signed URL for the object | * Location - redirect to S3
| +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**410** | object expired | - | +**416** | Requested Range Not Satisfiable | - | +**0** | Internal Server Error | - | + + +# **getUnderlyingProperties** +> UnderlyingObjectProperties getUnderlyingProperties(repository, ref, path) + +get object properties on underlying storage + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) + String path = "path_example"; // String | relative to the branch + try { + UnderlyingObjectProperties result = apiInstance.getUnderlyingProperties(repository, ref, path); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#getUnderlyingProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| a reference (could be either a branch or a commit ID) | + **path** | **String**| relative to the branch | + +### Return type + +[**UnderlyingObjectProperties**](UnderlyingObjectProperties.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object metadata on underlying storage | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **headObject** +> headObject(repository, ref, path, range) + +check if object exists + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) + String path = "path_example"; // String | relative to the ref + String range = "bytes=0-1023"; // String | Byte range to retrieve + try { + apiInstance.headObject(repository, ref, path, range); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#headObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| a reference (could be either a branch or a commit ID) | + **path** | **String**| relative to the ref | + **range** | **String**| Byte range to retrieve | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object exists | * Content-Length -
* Last-Modified -
* ETag -
| +**206** | partial object content info | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| +**401** | Unauthorized | - | +**404** | object not found | - | +**410** | object expired | - | +**416** | Requested Range Not Satisfiable | - | +**0** | internal server error | - | + + +# **listObjects** +> ObjectStatsList listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix) + +list objects under a given prefix + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) + Boolean userMetadata = true; // Boolean | + Boolean presign = true; // Boolean | + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by + String prefix = "prefix_example"; // String | return items prefixed with this value + try { + ObjectStatsList result = apiInstance.listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#listObjects"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| a reference (could be either a branch or a commit ID) | + **userMetadata** | **Boolean**| | [optional] [default to true] + **presign** | **Boolean**| | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **delimiter** | **String**| delimiter used to group common prefixes by | [optional] + **prefix** | **String**| return items prefixed with this value | [optional] + +### Return type + +[**ObjectStatsList**](ObjectStatsList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object listing | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **stageObject** +> ObjectStats stageObject(repository, branch, path, objectStageCreation) + +stage an object's metadata for the given branch + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + ObjectStageCreation objectStageCreation = new ObjectStageCreation(); // ObjectStageCreation | + try { + ObjectStats result = apiInstance.stageObject(repository, branch, path, objectStageCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#stageObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + **objectStageCreation** | [**ObjectStageCreation**](ObjectStageCreation.md)| | + +### Return type + +[**ObjectStats**](ObjectStats.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | object metadata | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **statObject** +> ObjectStats statObject(repository, ref, path, userMetadata, presign) + +get object metadata + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) + String path = "path_example"; // String | relative to the branch + Boolean userMetadata = true; // Boolean | + Boolean presign = true; // Boolean | + try { + ObjectStats result = apiInstance.statObject(repository, ref, path, userMetadata, presign); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#statObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| a reference (could be either a branch or a commit ID) | + **path** | **String**| relative to the branch | + **userMetadata** | **Boolean**| | [optional] [default to true] + **presign** | **Boolean**| | [optional] + +### Return type + +[**ObjectStats**](ObjectStats.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object metadata | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**400** | Bad Request | - | +**410** | object gone (but partial metadata may be available) | - | +**0** | Internal Server Error | - | + + +# **uploadObject** +> ObjectStats uploadObject(repository, branch, path, storageClass, ifNoneMatch, content) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.ObjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + ObjectsApi apiInstance = new ObjectsApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + String storageClass = "storageClass_example"; // String | + String ifNoneMatch = "*"; // String | Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet + File content = new File("/path/to/file"); // File | Only a single file per upload which must be named \\\"content\\\". + try { + ObjectStats result = apiInstance.uploadObject(repository, branch, path, storageClass, ifNoneMatch, content); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObjectsApi#uploadObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + **storageClass** | **String**| | [optional] + **ifNoneMatch** | **String**| Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet | [optional] + **content** | **File**| Only a single file per upload which must be named \\\"content\\\". | [optional] + +### Return type + +[**ObjectStats**](ObjectStats.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data, application/octet-stream + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | object metadata | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**412** | Precondition Failed | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/OtfDiffEntry.md b/clients/java-legacy/docs/OtfDiffEntry.md new file mode 100644 index 00000000000..9972a585ef3 --- /dev/null +++ b/clients/java-legacy/docs/OtfDiffEntry.md @@ -0,0 +1,27 @@ + + +# OtfDiffEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**timestamp** | **Integer** | | +**operation** | **String** | | +**operationContent** | **Object** | free form content describing the returned operation diff | +**operationType** | [**OperationTypeEnum**](#OperationTypeEnum) | the operation category (CUD) | + + + +## Enum: OperationTypeEnum + +Name | Value +---- | ----- +CREATE | "create" +UPDATE | "update" +DELETE | "delete" + + + diff --git a/clients/java-legacy/docs/OtfDiffList.md b/clients/java-legacy/docs/OtfDiffList.md new file mode 100644 index 00000000000..56883308a52 --- /dev/null +++ b/clients/java-legacy/docs/OtfDiffList.md @@ -0,0 +1,24 @@ + + +# OtfDiffList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**diffType** | [**DiffTypeEnum**](#DiffTypeEnum) | | [optional] +**results** | [**List<OtfDiffEntry>**](OtfDiffEntry.md) | | + + + +## Enum: DiffTypeEnum + +Name | Value +---- | ----- +CREATED | "created" +DROPPED | "dropped" +CHANGED | "changed" + + + diff --git a/clients/java-legacy/docs/Pagination.md b/clients/java-legacy/docs/Pagination.md new file mode 100644 index 00000000000..f4ca9a3a972 --- /dev/null +++ b/clients/java-legacy/docs/Pagination.md @@ -0,0 +1,16 @@ + + +# Pagination + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **Boolean** | Next page is available | +**nextOffset** | **String** | Token used to retrieve the next page | +**results** | **Integer** | Number of values found in the results | +**maxPerPage** | **Integer** | Maximal number of entries per page | + + + diff --git a/clients/java-legacy/docs/PathList.md b/clients/java-legacy/docs/PathList.md new file mode 100644 index 00000000000..d4e84921d2a --- /dev/null +++ b/clients/java-legacy/docs/PathList.md @@ -0,0 +1,13 @@ + + +# PathList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paths** | **List<String>** | | + + + diff --git a/clients/java-legacy/docs/Policy.md b/clients/java-legacy/docs/Policy.md new file mode 100644 index 00000000000..4f83f134c98 --- /dev/null +++ b/clients/java-legacy/docs/Policy.md @@ -0,0 +1,15 @@ + + +# Policy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | [optional] +**statement** | [**List<Statement>**](Statement.md) | | + + + diff --git a/clients/java-legacy/docs/PolicyList.md b/clients/java-legacy/docs/PolicyList.md new file mode 100644 index 00000000000..4ca1e729ed5 --- /dev/null +++ b/clients/java-legacy/docs/PolicyList.md @@ -0,0 +1,14 @@ + + +# PolicyList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Policy>**](Policy.md) | | + + + diff --git a/clients/java-legacy/docs/PrepareGCUncommittedRequest.md b/clients/java-legacy/docs/PrepareGCUncommittedRequest.md new file mode 100644 index 00000000000..a117f5cda1b --- /dev/null +++ b/clients/java-legacy/docs/PrepareGCUncommittedRequest.md @@ -0,0 +1,13 @@ + + +# PrepareGCUncommittedRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**continuationToken** | **String** | | [optional] + + + diff --git a/clients/java-legacy/docs/PrepareGCUncommittedResponse.md b/clients/java-legacy/docs/PrepareGCUncommittedResponse.md new file mode 100644 index 00000000000..372f18f64f4 --- /dev/null +++ b/clients/java-legacy/docs/PrepareGCUncommittedResponse.md @@ -0,0 +1,15 @@ + + +# PrepareGCUncommittedResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**runId** | **String** | | +**gcUncommittedLocation** | **String** | location of uncommitted information data | +**continuationToken** | **String** | | [optional] + + + diff --git a/clients/java-legacy/docs/RangeMetadata.md b/clients/java-legacy/docs/RangeMetadata.md new file mode 100644 index 00000000000..e1cab3c8a52 --- /dev/null +++ b/clients/java-legacy/docs/RangeMetadata.md @@ -0,0 +1,17 @@ + + +# RangeMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | ID of the range. | +**minKey** | **String** | First key in the range. | +**maxKey** | **String** | Last key in the range. | +**count** | **Integer** | Number of records in the range. | +**estimatedSize** | **Integer** | Estimated size of the range in bytes | + + + diff --git a/clients/java-legacy/docs/Ref.md b/clients/java-legacy/docs/Ref.md new file mode 100644 index 00000000000..181ed2cbc4a --- /dev/null +++ b/clients/java-legacy/docs/Ref.md @@ -0,0 +1,14 @@ + + +# Ref + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**commitId** | **String** | | + + + diff --git a/clients/java-legacy/docs/RefList.md b/clients/java-legacy/docs/RefList.md new file mode 100644 index 00000000000..3acde5d5362 --- /dev/null +++ b/clients/java-legacy/docs/RefList.md @@ -0,0 +1,14 @@ + + +# RefList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Ref>**](Ref.md) | | + + + diff --git a/clients/java-legacy/docs/RefsApi.md b/clients/java-legacy/docs/RefsApi.md new file mode 100644 index 00000000000..276efd60002 --- /dev/null +++ b/clients/java-legacy/docs/RefsApi.md @@ -0,0 +1,606 @@ +# RefsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**diffRefs**](RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references +[**dumpRefs**](RefsApi.md#dumpRefs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store +[**findMergeBase**](RefsApi.md#findMergeBase) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references +[**logCommits**](RefsApi.md#logCommits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. +[**mergeIntoBranch**](RefsApi.md#mergeIntoBranch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references +[**restoreRefs**](RefsApi.md#restoreRefs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store + + + +# **diffRefs** +> DiffList diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type) + +diff references + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + String leftRef = "leftRef_example"; // String | a reference (could be either a branch or a commit ID) + String rightRef = "rightRef_example"; // String | a reference (could be either a branch or a commit ID) to compare against + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + String prefix = "prefix_example"; // String | return items prefixed with this value + String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by + String type = "two_dot"; // String | + try { + DiffList result = apiInstance.diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#diffRefs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **leftRef** | **String**| a reference (could be either a branch or a commit ID) | + **rightRef** | **String**| a reference (could be either a branch or a commit ID) to compare against | + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **prefix** | **String**| return items prefixed with this value | [optional] + **delimiter** | **String**| delimiter used to group common prefixes by | [optional] + **type** | **String**| | [optional] [default to three_dot] [enum: two_dot, three_dot] + +### Return type + +[**DiffList**](DiffList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | diff between refs | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **dumpRefs** +> RefsDump dumpRefs(repository) + +Dump repository refs (tags, commits, branches) to object store + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + try { + RefsDump result = apiInstance.dumpRefs(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#dumpRefs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +[**RefsDump**](RefsDump.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | refs dump | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **findMergeBase** +> FindMergeBaseResult findMergeBase(repository, sourceRef, destinationBranch) + +find the merge base for 2 references + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + String sourceRef = "sourceRef_example"; // String | source ref + String destinationBranch = "destinationBranch_example"; // String | destination branch name + try { + FindMergeBaseResult result = apiInstance.findMergeBase(repository, sourceRef, destinationBranch); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#findMergeBase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **sourceRef** | **String**| source ref | + **destinationBranch** | **String**| destination branch name | + +### Return type + +[**FindMergeBaseResult**](FindMergeBaseResult.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Found the merge base | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **logCommits** +> CommitList logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent) + +get commit log from ref. If both objects and prefixes are empty, return all commits. + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + String ref = "ref_example"; // String | + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + List objects = Arrays.asList(); // List | list of paths, each element is a path of a specific object + List prefixes = Arrays.asList(); // List | list of paths, each element is a path of a prefix + Boolean limit = true; // Boolean | limit the number of items in return to 'amount'. Without further indication on actual number of items. + Boolean firstParent = true; // Boolean | if set to true, follow only the first parent upon reaching a merge commit + try { + CommitList result = apiInstance.logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#logCommits"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **ref** | **String**| | + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + **objects** | [**List<String>**](String.md)| list of paths, each element is a path of a specific object | [optional] + **prefixes** | [**List<String>**](String.md)| list of paths, each element is a path of a prefix | [optional] + **limit** | **Boolean**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] + **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional] + +### Return type + +[**CommitList**](CommitList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | commit log | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **mergeIntoBranch** +> MergeResult mergeIntoBranch(repository, sourceRef, destinationBranch, merge) + +merge references + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + String sourceRef = "sourceRef_example"; // String | source ref + String destinationBranch = "destinationBranch_example"; // String | destination branch name + Merge merge = new Merge(); // Merge | + try { + MergeResult result = apiInstance.mergeIntoBranch(repository, sourceRef, destinationBranch, merge); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#mergeIntoBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **sourceRef** | **String**| source ref | + **destinationBranch** | **String**| destination branch name | + **merge** | [**Merge**](Merge.md)| | [optional] + +### Return type + +[**MergeResult**](MergeResult.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | merge completed | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | +**412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +**0** | Internal Server Error | - | + + +# **restoreRefs** +> restoreRefs(repository, refsDump) + +Restore repository refs (tags, commits, branches) from object store + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RefsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RefsApi apiInstance = new RefsApi(defaultClient); + String repository = "repository_example"; // String | + RefsDump refsDump = new RefsDump(); // RefsDump | + try { + apiInstance.restoreRefs(repository, refsDump); + } catch (ApiException e) { + System.err.println("Exception when calling RefsApi#restoreRefs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **refsDump** | [**RefsDump**](RefsDump.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | refs successfully loaded | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/RefsDump.md b/clients/java-legacy/docs/RefsDump.md new file mode 100644 index 00000000000..832abf289e1 --- /dev/null +++ b/clients/java-legacy/docs/RefsDump.md @@ -0,0 +1,15 @@ + + +# RefsDump + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commitsMetaRangeId** | **String** | | +**tagsMetaRangeId** | **String** | | +**branchesMetaRangeId** | **String** | | + + + diff --git a/clients/java-legacy/docs/RepositoriesApi.md b/clients/java-legacy/docs/RepositoriesApi.md new file mode 100644 index 00000000000..a067e93588a --- /dev/null +++ b/clients/java-legacy/docs/RepositoriesApi.md @@ -0,0 +1,751 @@ +# RepositoriesApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBranchProtectionRule**](RepositoriesApi.md#createBranchProtectionRule) | **POST** /repositories/{repository}/branch_protection | +[**createRepository**](RepositoriesApi.md#createRepository) | **POST** /repositories | create repository +[**deleteBranchProtectionRule**](RepositoriesApi.md#deleteBranchProtectionRule) | **DELETE** /repositories/{repository}/branch_protection | +[**deleteRepository**](RepositoriesApi.md#deleteRepository) | **DELETE** /repositories/{repository} | delete repository +[**getBranchProtectionRules**](RepositoriesApi.md#getBranchProtectionRules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules +[**getRepository**](RepositoriesApi.md#getRepository) | **GET** /repositories/{repository} | get repository +[**getRepositoryMetadata**](RepositoriesApi.md#getRepositoryMetadata) | **GET** /repositories/{repository}/metadata | get repository metadata +[**listRepositories**](RepositoriesApi.md#listRepositories) | **GET** /repositories | list repositories + + + +# **createBranchProtectionRule** +> createBranchProtectionRule(repository, branchProtectionRule) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + BranchProtectionRule branchProtectionRule = new BranchProtectionRule(); // BranchProtectionRule | + try { + apiInstance.createBranchProtectionRule(repository, branchProtectionRule); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#createBranchProtectionRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branchProtectionRule** | [**BranchProtectionRule**](BranchProtectionRule.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | branch protection rule created successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **createRepository** +> Repository createRepository(repositoryCreation, bare) + +create repository + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + RepositoryCreation repositoryCreation = new RepositoryCreation(); // RepositoryCreation | + Boolean bare = false; // Boolean | If true, create a bare repository with no initial commit and branch + try { + Repository result = apiInstance.createRepository(repositoryCreation, bare); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#createRepository"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repositoryCreation** | [**RepositoryCreation**](RepositoryCreation.md)| | + **bare** | **Boolean**| If true, create a bare repository with no initial commit and branch | [optional] [default to false] + +### Return type + +[**Repository**](Repository.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | repository | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **deleteBranchProtectionRule** +> deleteBranchProtectionRule(repository, inlineObject1) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + InlineObject1 inlineObject1 = new InlineObject1(); // InlineObject1 | + try { + apiInstance.deleteBranchProtectionRule(repository, inlineObject1); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#deleteBranchProtectionRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **inlineObject1** | [**InlineObject1**](InlineObject1.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | branch protection rule deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **deleteRepository** +> deleteRepository(repository) + +delete repository + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + try { + apiInstance.deleteRepository(repository); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#deleteRepository"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | repository deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getBranchProtectionRules** +> List<BranchProtectionRule> getBranchProtectionRules(repository) + +get branch protection rules + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + try { + List result = apiInstance.getBranchProtectionRules(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#getBranchProtectionRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +[**List<BranchProtectionRule>**](BranchProtectionRule.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | branch protection rules | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getRepository** +> Repository getRepository(repository) + +get repository + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + try { + Repository result = apiInstance.getRepository(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#getRepository"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +[**Repository**](Repository.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | repository | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getRepositoryMetadata** +> Map<String, String> getRepositoryMetadata(repository) + +get repository metadata + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String repository = "repository_example"; // String | + try { + Map result = apiInstance.getRepositoryMetadata(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#getRepositoryMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +**Map<String, String>** + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | repository metadata | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listRepositories** +> RepositoryList listRepositories(prefix, after, amount) + +list repositories + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RepositoriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + RepositoryList result = apiInstance.listRepositories(prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RepositoriesApi#listRepositories"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**RepositoryList**](RepositoryList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | repository list | - | +**401** | Unauthorized | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/Repository.md b/clients/java-legacy/docs/Repository.md new file mode 100644 index 00000000000..a394d75cdc0 --- /dev/null +++ b/clients/java-legacy/docs/Repository.md @@ -0,0 +1,16 @@ + + +# Repository + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**creationDate** | **Long** | Unix Epoch in seconds | +**defaultBranch** | **String** | | +**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | + + + diff --git a/clients/java-legacy/docs/RepositoryCreation.md b/clients/java-legacy/docs/RepositoryCreation.md new file mode 100644 index 00000000000..b12b883e255 --- /dev/null +++ b/clients/java-legacy/docs/RepositoryCreation.md @@ -0,0 +1,16 @@ + + +# RepositoryCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | +**defaultBranch** | **String** | | [optional] +**sampleData** | **Boolean** | | [optional] + + + diff --git a/clients/java-legacy/docs/RepositoryList.md b/clients/java-legacy/docs/RepositoryList.md new file mode 100644 index 00000000000..84971056d79 --- /dev/null +++ b/clients/java-legacy/docs/RepositoryList.md @@ -0,0 +1,14 @@ + + +# RepositoryList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<Repository>**](Repository.md) | | + + + diff --git a/clients/java-legacy/docs/ResetCreation.md b/clients/java-legacy/docs/ResetCreation.md new file mode 100644 index 00000000000..b8f4d1c39c4 --- /dev/null +++ b/clients/java-legacy/docs/ResetCreation.md @@ -0,0 +1,24 @@ + + +# ResetCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**TypeEnum**](#TypeEnum) | | +**path** | **String** | | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +OBJECT | "object" +COMMON_PREFIX | "common_prefix" +RESET | "reset" + + + diff --git a/clients/java-legacy/docs/RetentionApi.md b/clients/java-legacy/docs/RetentionApi.md new file mode 100644 index 00000000000..898dcad9ff3 --- /dev/null +++ b/clients/java-legacy/docs/RetentionApi.md @@ -0,0 +1,471 @@ +# RetentionApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteGarbageCollectionRules**](RetentionApi.md#deleteGarbageCollectionRules) | **DELETE** /repositories/{repository}/gc/rules | +[**getGarbageCollectionRules**](RetentionApi.md#getGarbageCollectionRules) | **GET** /repositories/{repository}/gc/rules | +[**prepareGarbageCollectionCommits**](RetentionApi.md#prepareGarbageCollectionCommits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active commits for garbage collection +[**prepareGarbageCollectionUncommitted**](RetentionApi.md#prepareGarbageCollectionUncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection +[**setGarbageCollectionRules**](RetentionApi.md#setGarbageCollectionRules) | **POST** /repositories/{repository}/gc/rules | + + + +# **deleteGarbageCollectionRules** +> deleteGarbageCollectionRules(repository) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RetentionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RetentionApi apiInstance = new RetentionApi(defaultClient); + String repository = "repository_example"; // String | + try { + apiInstance.deleteGarbageCollectionRules(repository); + } catch (ApiException e) { + System.err.println("Exception when calling RetentionApi#deleteGarbageCollectionRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | deleted garbage collection rules successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getGarbageCollectionRules** +> GarbageCollectionRules getGarbageCollectionRules(repository) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RetentionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RetentionApi apiInstance = new RetentionApi(defaultClient); + String repository = "repository_example"; // String | + try { + GarbageCollectionRules result = apiInstance.getGarbageCollectionRules(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RetentionApi#getGarbageCollectionRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +[**GarbageCollectionRules**](GarbageCollectionRules.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | gc rule list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **prepareGarbageCollectionCommits** +> GarbageCollectionPrepareResponse prepareGarbageCollectionCommits(repository) + +save lists of active commits for garbage collection + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RetentionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RetentionApi apiInstance = new RetentionApi(defaultClient); + String repository = "repository_example"; // String | + try { + GarbageCollectionPrepareResponse result = apiInstance.prepareGarbageCollectionCommits(repository); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RetentionApi#prepareGarbageCollectionCommits"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + +### Return type + +[**GarbageCollectionPrepareResponse**](GarbageCollectionPrepareResponse.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | paths to commit dataset | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **prepareGarbageCollectionUncommitted** +> PrepareGCUncommittedResponse prepareGarbageCollectionUncommitted(repository, prepareGCUncommittedRequest) + +save repository uncommitted metadata for garbage collection + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RetentionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RetentionApi apiInstance = new RetentionApi(defaultClient); + String repository = "repository_example"; // String | + PrepareGCUncommittedRequest prepareGCUncommittedRequest = new PrepareGCUncommittedRequest(); // PrepareGCUncommittedRequest | + try { + PrepareGCUncommittedResponse result = apiInstance.prepareGarbageCollectionUncommitted(repository, prepareGCUncommittedRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RetentionApi#prepareGarbageCollectionUncommitted"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **prepareGCUncommittedRequest** | [**PrepareGCUncommittedRequest**](PrepareGCUncommittedRequest.md)| | [optional] + +### Return type + +[**PrepareGCUncommittedResponse**](PrepareGCUncommittedResponse.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | paths to commit dataset | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **setGarbageCollectionRules** +> setGarbageCollectionRules(repository, garbageCollectionRules) + + + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.RetentionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + RetentionApi apiInstance = new RetentionApi(defaultClient); + String repository = "repository_example"; // String | + GarbageCollectionRules garbageCollectionRules = new GarbageCollectionRules(); // GarbageCollectionRules | + try { + apiInstance.setGarbageCollectionRules(repository, garbageCollectionRules); + } catch (ApiException e) { + System.err.println("Exception when calling RetentionApi#setGarbageCollectionRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **garbageCollectionRules** | [**GarbageCollectionRules**](GarbageCollectionRules.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | set garbage collection rules successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/RevertCreation.md b/clients/java-legacy/docs/RevertCreation.md new file mode 100644 index 00000000000..6b61850abbb --- /dev/null +++ b/clients/java-legacy/docs/RevertCreation.md @@ -0,0 +1,14 @@ + + +# RevertCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref** | **String** | the commit to revert, given by a ref | +**parentNumber** | **Integer** | when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. | + + + diff --git a/clients/java-legacy/docs/Setup.md b/clients/java-legacy/docs/Setup.md new file mode 100644 index 00000000000..a8940098dcc --- /dev/null +++ b/clients/java-legacy/docs/Setup.md @@ -0,0 +1,14 @@ + + +# Setup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | an identifier for the user (e.g. jane.doe) | +**key** | [**AccessKeyCredentials**](AccessKeyCredentials.md) | | [optional] + + + diff --git a/clients/java-legacy/docs/SetupState.md b/clients/java-legacy/docs/SetupState.md new file mode 100644 index 00000000000..f7e6b3e4190 --- /dev/null +++ b/clients/java-legacy/docs/SetupState.md @@ -0,0 +1,24 @@ + + +# SetupState + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | [**StateEnum**](#StateEnum) | | [optional] +**commPrefsMissing** | **Boolean** | true if the comm prefs are missing. | [optional] +**loginConfig** | [**LoginConfig**](LoginConfig.md) | | [optional] + + + +## Enum: StateEnum + +Name | Value +---- | ----- +INITIALIZED | "initialized" +NOT_INITIALIZED | "not_initialized" + + + diff --git a/clients/java-legacy/docs/StagingApi.md b/clients/java-legacy/docs/StagingApi.md new file mode 100644 index 00000000000..7ffb19e38b8 --- /dev/null +++ b/clients/java-legacy/docs/StagingApi.md @@ -0,0 +1,208 @@ +# StagingApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getPhysicalAddress**](StagingApi.md#getPhysicalAddress) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage +[**linkPhysicalAddress**](StagingApi.md#linkPhysicalAddress) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path + + + +# **getPhysicalAddress** +> StagingLocation getPhysicalAddress(repository, branch, path, presign) + +get a physical address and a return token to write object to underlying storage + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.StagingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + StagingApi apiInstance = new StagingApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + Boolean presign = true; // Boolean | + try { + StagingLocation result = apiInstance.getPhysicalAddress(repository, branch, path, presign); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StagingApi#getPhysicalAddress"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + **presign** | **Boolean**| | [optional] + +### Return type + +[**StagingLocation**](StagingLocation.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | physical address for staging area | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **linkPhysicalAddress** +> ObjectStats linkPhysicalAddress(repository, branch, path, stagingMetadata) + +associate staging on this physical address with a path + +If the supplied token matches the current staging token, associate the object as the physical address with the supplied path. Otherwise, if staging has been committed and the token has expired, return a conflict and hint where to place the object to try again. Caller should copy the object to the new physical address and PUT again with the new staging token. (No need to back off, this is due to losing the race against a concurrent commit operation.) + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.StagingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + StagingApi apiInstance = new StagingApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String path = "path_example"; // String | relative to the branch + StagingMetadata stagingMetadata = new StagingMetadata(); // StagingMetadata | + try { + ObjectStats result = apiInstance.linkPhysicalAddress(repository, branch, path, stagingMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StagingApi#linkPhysicalAddress"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **path** | **String**| relative to the branch | + **stagingMetadata** | [**StagingMetadata**](StagingMetadata.md)| | + +### Return type + +[**ObjectStats**](ObjectStats.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | object metadata | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Internal Server Error | - | +**409** | conflict with a commit, try here | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/StagingLocation.md b/clients/java-legacy/docs/StagingLocation.md new file mode 100644 index 00000000000..aa20403bec4 --- /dev/null +++ b/clients/java-legacy/docs/StagingLocation.md @@ -0,0 +1,17 @@ + + +# StagingLocation + +location for placing an object when staging it + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**physicalAddress** | **String** | | [optional] +**token** | **String** | opaque staging token to use to link uploaded object | +**presignedUrl** | **String** | if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading | [optional] +**presignedUrlExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] + + + diff --git a/clients/java-legacy/docs/StagingMetadata.md b/clients/java-legacy/docs/StagingMetadata.md new file mode 100644 index 00000000000..569e5edbeca --- /dev/null +++ b/clients/java-legacy/docs/StagingMetadata.md @@ -0,0 +1,18 @@ + + +# StagingMetadata + +information about uploaded object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**staging** | [**StagingLocation**](StagingLocation.md) | | +**checksum** | **String** | unique identifier of object content on backing store (typically ETag) | +**sizeBytes** | **Long** | | +**userMetadata** | **Map<String, String>** | | [optional] +**contentType** | **String** | Object media type | [optional] + + + diff --git a/clients/java-legacy/docs/Statement.md b/clients/java-legacy/docs/Statement.md new file mode 100644 index 00000000000..c95e6d3770c --- /dev/null +++ b/clients/java-legacy/docs/Statement.md @@ -0,0 +1,24 @@ + + +# Statement + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effect** | [**EffectEnum**](#EffectEnum) | | +**resource** | **String** | | +**action** | **List<String>** | | + + + +## Enum: EffectEnum + +Name | Value +---- | ----- +ALLOW | "allow" +DENY | "deny" + + + diff --git a/clients/java-legacy/docs/StatsEvent.md b/clients/java-legacy/docs/StatsEvent.md new file mode 100644 index 00000000000..c1de16909c5 --- /dev/null +++ b/clients/java-legacy/docs/StatsEvent.md @@ -0,0 +1,15 @@ + + +# StatsEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **String** | stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\") | +**name** | **String** | stats event name (e.g. \"put_object\", \"create_repository\", \"<experimental-feature-name>\") | +**count** | **Integer** | number of events of the class and name | + + + diff --git a/clients/java-legacy/docs/StatsEventsList.md b/clients/java-legacy/docs/StatsEventsList.md new file mode 100644 index 00000000000..331b12f6df6 --- /dev/null +++ b/clients/java-legacy/docs/StatsEventsList.md @@ -0,0 +1,13 @@ + + +# StatsEventsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List<StatsEvent>**](StatsEvent.md) | | + + + diff --git a/clients/java-legacy/docs/StorageConfig.md b/clients/java-legacy/docs/StorageConfig.md new file mode 100644 index 00000000000..6f176a63b5e --- /dev/null +++ b/clients/java-legacy/docs/StorageConfig.md @@ -0,0 +1,20 @@ + + +# StorageConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**blockstoreType** | **String** | | +**blockstoreNamespaceExample** | **String** | | +**blockstoreNamespaceValidityRegex** | **String** | | +**defaultNamespacePrefix** | **String** | | [optional] +**preSignSupport** | **Boolean** | | +**preSignSupportUi** | **Boolean** | | +**importSupport** | **Boolean** | | +**importValidityRegex** | **String** | | + + + diff --git a/clients/java-legacy/docs/StorageURI.md b/clients/java-legacy/docs/StorageURI.md new file mode 100644 index 00000000000..e890eae4d13 --- /dev/null +++ b/clients/java-legacy/docs/StorageURI.md @@ -0,0 +1,14 @@ + + +# StorageURI + +URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **String** | | + + + diff --git a/clients/java-legacy/docs/TagCreation.md b/clients/java-legacy/docs/TagCreation.md new file mode 100644 index 00000000000..ee60d98d41a --- /dev/null +++ b/clients/java-legacy/docs/TagCreation.md @@ -0,0 +1,14 @@ + + +# TagCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**ref** | **String** | | + + + diff --git a/clients/java-legacy/docs/TagsApi.md b/clients/java-legacy/docs/TagsApi.md new file mode 100644 index 00000000000..1ca1ae90ac2 --- /dev/null +++ b/clients/java-legacy/docs/TagsApi.md @@ -0,0 +1,389 @@ +# TagsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTag**](TagsApi.md#createTag) | **POST** /repositories/{repository}/tags | create tag +[**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag +[**getTag**](TagsApi.md#getTag) | **GET** /repositories/{repository}/tags/{tag} | get tag +[**listTags**](TagsApi.md#listTags) | **GET** /repositories/{repository}/tags | list tags + + + +# **createTag** +> Ref createTag(repository, tagCreation) + +create tag + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + TagsApi apiInstance = new TagsApi(defaultClient); + String repository = "repository_example"; // String | + TagCreation tagCreation = new TagCreation(); // TagCreation | + try { + Ref result = apiInstance.createTag(repository, tagCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#createTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **tagCreation** | [**TagCreation**](TagCreation.md)| | + +### Return type + +[**Ref**](Ref.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | tag | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + + +# **deleteTag** +> deleteTag(repository, tag) + +delete tag + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + TagsApi apiInstance = new TagsApi(defaultClient); + String repository = "repository_example"; // String | + String tag = "tag_example"; // String | + try { + apiInstance.deleteTag(repository, tag); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#deleteTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **tag** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | tag deleted successfully | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **getTag** +> Ref getTag(repository, tag) + +get tag + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + TagsApi apiInstance = new TagsApi(defaultClient); + String repository = "repository_example"; // String | + String tag = "tag_example"; // String | + try { + Ref result = apiInstance.getTag(repository, tag); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#getTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **tag** | **String**| | + +### Return type + +[**Ref**](Ref.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | tag | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + + +# **listTags** +> RefList listTags(repository, prefix, after, amount) + +list tags + +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + TagsApi apiInstance = new TagsApi(defaultClient); + String repository = "repository_example"; // String | + String prefix = "prefix_example"; // String | return items prefixed with this value + String after = "after_example"; // String | return items after this value + Integer amount = 100; // Integer | how many items to return + try { + RefList result = apiInstance.listTags(repository, prefix, after, amount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#listTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **prefix** | **String**| return items prefixed with this value | [optional] + **after** | **String**| return items after this value | [optional] + **amount** | **Integer**| how many items to return | [optional] [default to 100] + +### Return type + +[**RefList**](RefList.md) + +### Authorization + +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | tag list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/UnderlyingObjectProperties.md b/clients/java-legacy/docs/UnderlyingObjectProperties.md new file mode 100644 index 00000000000..f9be999984a --- /dev/null +++ b/clients/java-legacy/docs/UnderlyingObjectProperties.md @@ -0,0 +1,13 @@ + + +# UnderlyingObjectProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**storageClass** | **String** | | [optional] + + + diff --git a/clients/java-legacy/docs/UpdateToken.md b/clients/java-legacy/docs/UpdateToken.md new file mode 100644 index 00000000000..76520c19779 --- /dev/null +++ b/clients/java-legacy/docs/UpdateToken.md @@ -0,0 +1,13 @@ + + +# UpdateToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stagingToken** | **String** | | + + + diff --git a/clients/java-legacy/docs/User.md b/clients/java-legacy/docs/User.md new file mode 100644 index 00000000000..fe543e554df --- /dev/null +++ b/clients/java-legacy/docs/User.md @@ -0,0 +1,15 @@ + + +# User + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | a unique identifier for the user. | +**creationDate** | **Long** | Unix Epoch in seconds | +**friendlyName** | **String** | | [optional] + + + diff --git a/clients/java-legacy/docs/UserCreation.md b/clients/java-legacy/docs/UserCreation.md new file mode 100644 index 00000000000..12d8a5af0a7 --- /dev/null +++ b/clients/java-legacy/docs/UserCreation.md @@ -0,0 +1,14 @@ + + +# UserCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | a unique identifier for the user. | +**inviteUser** | **Boolean** | | [optional] + + + diff --git a/clients/java-legacy/docs/UserList.md b/clients/java-legacy/docs/UserList.md new file mode 100644 index 00000000000..b60eea08366 --- /dev/null +++ b/clients/java-legacy/docs/UserList.md @@ -0,0 +1,14 @@ + + +# UserList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<User>**](User.md) | | + + + diff --git a/clients/java-legacy/docs/VersionConfig.md b/clients/java-legacy/docs/VersionConfig.md new file mode 100644 index 00000000000..60716f23596 --- /dev/null +++ b/clients/java-legacy/docs/VersionConfig.md @@ -0,0 +1,16 @@ + + +# VersionConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **String** | | [optional] +**latestVersion** | **String** | | [optional] +**upgradeRecommended** | **Boolean** | | [optional] +**upgradeUrl** | **String** | | [optional] + + + diff --git a/clients/java-legacy/git_push.sh b/clients/java-legacy/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/clients/java-legacy/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/java-legacy/gradle.properties b/clients/java-legacy/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/clients/java-legacy/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/clients/java-legacy/gradle/wrapper/gradle-wrapper.jar b/clients/java-legacy/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..7454180f2ae Binary files /dev/null and b/clients/java-legacy/gradle/wrapper/gradle-wrapper.jar differ diff --git a/clients/java-legacy/gradle/wrapper/gradle-wrapper.properties b/clients/java-legacy/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..ffed3a254e9 --- /dev/null +++ b/clients/java-legacy/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/clients/java-legacy/gradlew b/clients/java-legacy/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/clients/java-legacy/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/clients/java-legacy/gradlew.bat b/clients/java-legacy/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/clients/java-legacy/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/clients/java-legacy/pom.xml b/clients/java-legacy/pom.xml new file mode 100644 index 00000000000..bec16246a3a --- /dev/null +++ b/clients/java-legacy/pom.xml @@ -0,0 +1,299 @@ + + 4.0.0 + io.lakefs + api-client + jar + api-client + 0.1.0-SNAPSHOT + https://lakefs.io + lakeFS OpenAPI Java client legacy SDK + + scm:git:git@github.com:treeverse/lakeFS.git + scm:git:git@github.com:treeverse/lakeFS.git + https://github.com/treeverse/lakeFS + + + io.lakefs + lakefs-parent + 0 + + + + + apache2 + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + Treeverse lakeFS dev + services@treeverse.io + lakefs.io + https://lakefs.io + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M4 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + org.threeten + threetenbp + ${threetenbp-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + junit + junit + ${junit-version} + test + + + org.mockito + mockito-core + 3.11.2 + test + + + + 1.7 + ${java.version} + ${java.version} + 1.8.5 + 1.6.2 + 4.9.1 + 2.8.6 + 3.11 + 0.2.1 + 1.5.0 + 1.3.5 + 4.13.1 + UTF-8 + + diff --git a/clients/java-legacy/settings.gradle b/clients/java-legacy/settings.gradle new file mode 100644 index 00000000000..5d37c7c9cc6 --- /dev/null +++ b/clients/java-legacy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "api-client" \ No newline at end of file diff --git a/clients/java-legacy/src/main/AndroidManifest.xml b/clients/java-legacy/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..3cd2967e7be --- /dev/null +++ b/clients/java-legacy/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ActionsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ActionsApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ActionsApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ActionsApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ApiCallback.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiCallback.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ApiCallback.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiCallback.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ApiClient.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiClient.java similarity index 99% rename from clients/java/src/main/java/io/lakefs/clients/api/ApiClient.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiClient.java index 8f38b12e601..5037a00aa8c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/ApiClient.java +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiClient.java @@ -133,7 +133,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("lakefs-java-sdk/0.1.0-SNAPSHOT"); + setUserAgent("lakefs-java-sdk/0.1.0-SNAPSHOT-legacy"); authentications = new HashMap(); } diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ApiException.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiException.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ApiException.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiException.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ApiResponse.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiResponse.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ApiResponse.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ApiResponse.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/AuthApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/AuthApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/AuthApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/AuthApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/CommitsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/CommitsApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/CommitsApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/CommitsApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ConfigApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ConfigApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/Configuration.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/Configuration.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/Configuration.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/Configuration.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ExperimentalApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ExperimentalApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/GzipRequestInterceptor.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/GzipRequestInterceptor.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/GzipRequestInterceptor.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/GzipRequestInterceptor.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/HealthCheckApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/HealthCheckApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/HealthCheckApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/HealthCheckApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ImportApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ImportApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ImportApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ImportApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/InternalApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/InternalApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/JSON.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/JSON.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/JSON.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/JSON.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/MetadataApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/MetadataApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ObjectsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ObjectsApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ObjectsApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ObjectsApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/Pair.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/Pair.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/Pair.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/Pair.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ProgressRequestBody.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ProgressRequestBody.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ProgressRequestBody.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ProgressRequestBody.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ProgressResponseBody.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ProgressResponseBody.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ProgressResponseBody.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ProgressResponseBody.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/RefsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/RefsApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/RepositoriesApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/RepositoriesApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/RepositoriesApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/RepositoriesApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/RetentionApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/RetentionApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/RetentionApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/RetentionApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ServerConfiguration.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ServerConfiguration.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ServerConfiguration.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ServerConfiguration.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ServerVariable.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ServerVariable.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/ServerVariable.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/ServerVariable.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/StagingApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/StagingApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/StagingApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/StagingApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/StringUtil.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/StringUtil.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/StringUtil.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/StringUtil.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/TagsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/TagsApi.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/TagsApi.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/TagsApi.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/auth/ApiKeyAuth.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/ApiKeyAuth.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/auth/ApiKeyAuth.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/ApiKeyAuth.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/auth/Authentication.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/Authentication.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/auth/Authentication.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/Authentication.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/auth/HttpBasicAuth.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/HttpBasicAuth.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/auth/HttpBasicAuth.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/HttpBasicAuth.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/auth/HttpBearerAuth.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/HttpBearerAuth.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/auth/HttpBearerAuth.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/auth/HttpBearerAuth.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ACL.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ACL.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ACL.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ACL.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/AccessKeyCredentials.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AccessKeyCredentials.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/AccessKeyCredentials.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AccessKeyCredentials.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ActionRun.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ActionRun.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ActionRun.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ActionRun.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ActionRunList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ActionRunList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ActionRunList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ActionRunList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/AuthCapabilities.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AuthCapabilities.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/AuthCapabilities.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AuthCapabilities.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/AuthenticationToken.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AuthenticationToken.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/AuthenticationToken.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/AuthenticationToken.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/BranchCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/BranchCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/BranchCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/BranchCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/BranchProtectionRule.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/BranchProtectionRule.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/BranchProtectionRule.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/BranchProtectionRule.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CommPrefsInput.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommPrefsInput.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CommPrefsInput.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommPrefsInput.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Commit.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Commit.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Commit.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Commit.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CommitCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommitCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CommitCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommitCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CommitList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommitList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CommitList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CommitList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Credentials.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Credentials.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Credentials.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Credentials.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CredentialsList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CredentialsList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CredentialsList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CredentialsList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CredentialsWithSecret.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CredentialsWithSecret.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CredentialsWithSecret.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CredentialsWithSecret.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CurrentUser.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CurrentUser.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/CurrentUser.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/CurrentUser.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Diff.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Diff.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Diff.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Diff.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/DiffList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/DiffList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/DiffList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/DiffList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/DiffProperties.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/DiffProperties.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/DiffProperties.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/DiffProperties.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Error.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Error.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Error.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Error.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ErrorNoACL.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ErrorNoACL.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ErrorNoACL.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ErrorNoACL.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/FindMergeBaseResult.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/FindMergeBaseResult.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/FindMergeBaseResult.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/FindMergeBaseResult.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionConfig.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionConfig.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionConfig.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionConfig.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponse.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponse.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponse.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponse.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRule.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRule.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRule.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRule.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRules.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRules.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRules.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GarbageCollectionRules.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Group.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Group.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Group.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Group.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GroupCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GroupCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GroupCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GroupCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/GroupList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GroupList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/GroupList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/GroupList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/HookRun.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/HookRun.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/HookRun.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/HookRun.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/HookRunList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/HookRunList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/HookRunList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/HookRunList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ImportCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ImportCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ImportCreationResponse.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportCreationResponse.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ImportCreationResponse.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportCreationResponse.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ImportLocation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportLocation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ImportLocation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportLocation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ImportStatus.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportStatus.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ImportStatus.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ImportStatus.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/InlineObject.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/InlineObject.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/InlineObject.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/InlineObject.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/InlineObject1.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/InlineObject1.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/InlineObject1.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/InlineObject1.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/LoginConfig.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/LoginConfig.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/LoginConfig.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/LoginConfig.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/LoginInformation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/LoginInformation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/LoginInformation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/LoginInformation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Merge.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Merge.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Merge.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Merge.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/MergeResult.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MergeResult.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/MergeResult.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MergeResult.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/MetaRangeCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MetaRangeCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/MetaRangeCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MetaRangeCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/MetaRangeCreationResponse.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MetaRangeCreationResponse.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/MetaRangeCreationResponse.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/MetaRangeCreationResponse.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/OTFDiffs.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OTFDiffs.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/OTFDiffs.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OTFDiffs.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectCopyCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectCopyCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectCopyCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectCopyCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectError.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectError.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectError.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectError.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectErrorList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectErrorList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectErrorList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectErrorList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStageCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStageCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStageCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStageCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStats.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStats.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStats.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStats.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStatsList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStatsList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ObjectStatsList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ObjectStatsList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/OtfDiffEntry.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OtfDiffEntry.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/OtfDiffEntry.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OtfDiffEntry.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/OtfDiffList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OtfDiffList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/OtfDiffList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/OtfDiffList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Pagination.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Pagination.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Pagination.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Pagination.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/PathList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PathList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/PathList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PathList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Policy.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Policy.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Policy.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Policy.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/PolicyList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PolicyList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/PolicyList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PolicyList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequest.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequest.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequest.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequest.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponse.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponse.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponse.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponse.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RangeMetadata.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RangeMetadata.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RangeMetadata.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RangeMetadata.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Ref.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Ref.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Ref.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Ref.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RefList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RefList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RefList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RefList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RefsDump.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RefsDump.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RefsDump.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RefsDump.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Repository.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Repository.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Repository.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Repository.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RepositoryCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RepositoryCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RepositoryCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RepositoryCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RepositoryList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RepositoryList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RepositoryList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RepositoryList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/ResetCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ResetCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/ResetCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/ResetCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/RevertCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RevertCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/RevertCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/RevertCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Setup.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Setup.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Setup.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Setup.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/SetupState.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/SetupState.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/SetupState.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/SetupState.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StagingLocation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StagingLocation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StagingLocation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StagingLocation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StagingMetadata.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StagingMetadata.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StagingMetadata.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StagingMetadata.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Statement.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Statement.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/Statement.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/Statement.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StatsEvent.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StatsEvent.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StatsEvent.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StatsEvent.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StatsEventsList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StatsEventsList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StatsEventsList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StatsEventsList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StorageConfig.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StorageConfig.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StorageConfig.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StorageConfig.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/StorageURI.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StorageURI.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/StorageURI.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/StorageURI.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/TagCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/TagCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/TagCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/TagCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/UnderlyingObjectProperties.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UnderlyingObjectProperties.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/UnderlyingObjectProperties.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UnderlyingObjectProperties.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/UpdateToken.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UpdateToken.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/UpdateToken.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UpdateToken.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/User.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/User.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/User.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/User.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/UserCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UserCreation.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/UserCreation.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UserCreation.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/UserList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UserList.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/UserList.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/UserList.java diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/VersionConfig.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/VersionConfig.java similarity index 100% rename from clients/java/src/main/java/io/lakefs/clients/api/model/VersionConfig.java rename to clients/java-legacy/src/main/java/io/lakefs/clients/api/model/VersionConfig.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ActionsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ActionsApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/ActionsApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/ActionsApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/AuthApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/AuthApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/AuthApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/AuthApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/BranchesApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/BranchesApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/CommitsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/CommitsApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/CommitsApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/CommitsApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ConfigApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/ConfigApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/HealthCheckApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/HealthCheckApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/HealthCheckApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/HealthCheckApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ImportApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ImportApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/ImportApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/ImportApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/InternalApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/InternalApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/MetadataApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/MetadataApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ObjectsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ObjectsApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/ObjectsApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/ObjectsApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/RefsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/RefsApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/RefsApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/RefsApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/RepositoriesApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/RepositoriesApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/RepositoriesApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/RepositoriesApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/RetentionApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/RetentionApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/RetentionApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/RetentionApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/StagingApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/StagingApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/StagingApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/StagingApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/TagsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/TagsApiTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/TagsApiTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/TagsApiTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ACLTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ACLTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ACLTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ACLTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/AccessKeyCredentialsTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AccessKeyCredentialsTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/AccessKeyCredentialsTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AccessKeyCredentialsTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ActionRunListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ActionRunListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ActionRunListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ActionRunListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ActionRunTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ActionRunTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ActionRunTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ActionRunTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/AuthCapabilitiesTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AuthCapabilitiesTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/AuthCapabilitiesTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AuthCapabilitiesTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/AuthenticationTokenTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AuthenticationTokenTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/AuthenticationTokenTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/AuthenticationTokenTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/BranchCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/BranchCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/BranchCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/BranchCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/BranchProtectionRuleTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/BranchProtectionRuleTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/BranchProtectionRuleTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/BranchProtectionRuleTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CommPrefsInputTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommPrefsInputTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CommPrefsInputTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommPrefsInputTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CommitCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CommitCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CommitListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CommitListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CommitTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CommitTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CommitTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsWithSecretTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsWithSecretTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CredentialsWithSecretTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CredentialsWithSecretTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CurrentUserTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CurrentUserTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/CurrentUserTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/CurrentUserTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/DiffListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/DiffListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/DiffPropertiesTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffPropertiesTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/DiffPropertiesTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffPropertiesTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/DiffTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/DiffTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/DiffTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ErrorNoACLTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ErrorNoACLTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ErrorNoACLTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ErrorNoACLTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ErrorTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ErrorTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ErrorTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ErrorTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/FindMergeBaseResultTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/FindMergeBaseResultTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/FindMergeBaseResultTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/FindMergeBaseResultTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionConfigTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionConfigTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionConfigTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionConfigTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponseTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponseTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponseTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionPrepareResponseTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRuleTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRuleTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRuleTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRuleTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRulesTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRulesTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRulesTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GarbageCollectionRulesTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GroupCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GroupCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GroupListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GroupListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/GroupTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/GroupTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/GroupTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/HookRunListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/HookRunListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/HookRunListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/HookRunListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/HookRunTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/HookRunTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/HookRunTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/HookRunTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ImportCreationResponseTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportCreationResponseTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ImportCreationResponseTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportCreationResponseTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ImportCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ImportCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ImportLocationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportLocationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ImportLocationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportLocationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ImportStatusTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportStatusTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ImportStatusTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ImportStatusTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/InlineObject1Test.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/InlineObject1Test.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/InlineObject1Test.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/InlineObject1Test.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/InlineObjectTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/InlineObjectTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/InlineObjectTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/InlineObjectTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/LoginConfigTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/LoginConfigTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/LoginConfigTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/LoginConfigTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/LoginInformationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/LoginInformationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/LoginInformationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/LoginInformationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/MergeResultTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MergeResultTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/MergeResultTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MergeResultTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/MergeTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MergeTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/MergeTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MergeTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationResponseTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationResponseTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationResponseTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationResponseTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/MetaRangeCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/OTFDiffsTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OTFDiffsTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/OTFDiffsTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OTFDiffsTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectCopyCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectCopyCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectCopyCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectCopyCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectErrorListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectErrorListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectErrorListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectErrorListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectErrorTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectErrorTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectErrorTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectErrorTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStageCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStageCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStageCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStageCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStatsListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStatsListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStatsListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStatsListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStatsTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStatsTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ObjectStatsTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ObjectStatsTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/OtfDiffEntryTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OtfDiffEntryTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/OtfDiffEntryTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OtfDiffEntryTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/OtfDiffListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OtfDiffListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/OtfDiffListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/OtfDiffListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PaginationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PaginationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PaginationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PaginationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PathListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PathListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PathListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PathListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PolicyListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PolicyListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PolicyListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PolicyListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PolicyTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PolicyTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PolicyTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PolicyTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequestTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequestTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequestTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedRequestTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponseTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponseTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponseTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PrepareGCUncommittedResponseTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RangeMetadataTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RangeMetadataTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RangeMetadataTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RangeMetadataTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RefListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RefListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RefTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RefTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RefsDumpTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefsDumpTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RefsDumpTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RefsDumpTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RepositoryTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RepositoryTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ResetCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ResetCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/ResetCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/ResetCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/RevertCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RevertCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/RevertCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/RevertCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/SetupStateTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/SetupStateTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/SetupStateTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/SetupStateTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/SetupTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/SetupTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/SetupTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/SetupTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StagingLocationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StagingLocationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StagingLocationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StagingLocationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StagingMetadataTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StagingMetadataTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StagingMetadataTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StagingMetadataTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StatementTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatementTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StatementTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatementTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StatsEventTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatsEventTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StatsEventTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatsEventTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StatsEventsListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatsEventsListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StatsEventsListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StatsEventsListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StorageConfigTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StorageConfigTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StorageConfigTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StorageConfigTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/StorageURITest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StorageURITest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/StorageURITest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/StorageURITest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/TagCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/TagCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/TagCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/TagCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/UnderlyingObjectPropertiesTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UnderlyingObjectPropertiesTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/UnderlyingObjectPropertiesTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UnderlyingObjectPropertiesTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/UpdateTokenTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UpdateTokenTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/UpdateTokenTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UpdateTokenTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/UserCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserCreationTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/UserCreationTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserCreationTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/UserListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserListTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/UserListTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserListTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/UserTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/UserTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/UserTest.java diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/VersionConfigTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/VersionConfigTest.java similarity index 100% rename from clients/java/src/test/java/io/lakefs/clients/api/model/VersionConfigTest.java rename to clients/java-legacy/src/test/java/io/lakefs/clients/api/model/VersionConfigTest.java diff --git a/clients/java/.openapi-generator-ignore b/clients/java/.openapi-generator-ignore index 7484ee590a3..d7c7da26666 100644 --- a/clients/java/.openapi-generator-ignore +++ b/clients/java/.openapi-generator-ignore @@ -1,23 +1,3 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# Files to ignore (skip) when generating Java client +maven.yml +.github/ diff --git a/clients/java/.openapi-generator/VERSION b/clients/java/.openapi-generator/VERSION index e230c8396d1..4122521804f 100644 --- a/clients/java/.openapi-generator/VERSION +++ b/clients/java/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0 \ No newline at end of file +7.0.0 \ No newline at end of file diff --git a/clients/java/README.md b/clients/java/README.md index 1de03ea9ebe..64251b9c030 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -1,4 +1,4 @@ -# api-client +# sdk-client lakeFS API - API version: 0.1.0 @@ -12,8 +12,8 @@ lakeFS HTTP API ## Requirements Building the API client library requires: -1. Java 1.7+ -2. Maven/Gradle +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) ## Installation @@ -38,7 +38,7 @@ Add this dependency to your project's POM: ```xml io.lakefs - api-client + sdk-client 0.1.0-SNAPSHOT compile @@ -49,7 +49,14 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.lakefs:api-client:0.1.0-SNAPSHOT" + repositories { + mavenCentral() // Needed if the 'sdk-client' jar has been published to maven central. + mavenLocal() // Needed if the 'sdk-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "io.lakefs:sdk-client:0.1.0-SNAPSHOT" + } ``` ### Others @@ -62,7 +69,7 @@ mvn clean package Then manually install the following JARs: -* `target/api-client-0.1.0-SNAPSHOT.jar` +* `target/sdk-client-0.1.0-SNAPSHOT.jar` * `target/lib/*.jar` ## Getting Started @@ -72,17 +79,17 @@ Please follow the [installation](#installation) instruction and execute the foll ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ActionsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ActionsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -95,10 +102,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -111,11 +114,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ActionsApi apiInstance = new ActionsApi(defaultClient); String repository = "repository_example"; // String | String runId = "runId_example"; // String | try { - ActionRun result = apiInstance.getRun(repository, runId); + ActionRun result = apiInstance.getRun(repository, runId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ActionsApi#getRun"); @@ -131,7 +139,7 @@ public class Example { ## Documentation for API Endpoints -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -256,6 +264,7 @@ Class | Method | HTTP request | Description - [CredentialsList](docs/CredentialsList.md) - [CredentialsWithSecret](docs/CredentialsWithSecret.md) - [CurrentUser](docs/CurrentUser.md) + - [DeleteBranchProtectionRuleRequest](docs/DeleteBranchProtectionRuleRequest.md) - [Diff](docs/Diff.md) - [DiffList](docs/DiffList.md) - [DiffProperties](docs/DiffProperties.md) @@ -275,8 +284,6 @@ Class | Method | HTTP request | Description - [ImportCreationResponse](docs/ImportCreationResponse.md) - [ImportLocation](docs/ImportLocation.md) - [ImportStatus](docs/ImportStatus.md) - - [InlineObject](docs/InlineObject.md) - - [InlineObject1](docs/InlineObject1.md) - [LoginConfig](docs/LoginConfig.md) - [LoginInformation](docs/LoginInformation.md) - [Merge](docs/Merge.md) @@ -325,29 +332,36 @@ Class | Method | HTTP request | Description - [VersionConfig](docs/VersionConfig.md) + ## Documentation for Authorization + Authentication schemes defined for the API: + ### basic_auth - **Type**: HTTP basic authentication + +### jwt_token + +- **Type**: HTTP Bearer Token authentication (JWT) + + ### cookie_auth - **Type**: API key - **API key parameter name**: internal_auth_session - **Location**: -### jwt_token - -- **Type**: HTTP basic authentication - + ### oidc_auth - **Type**: API key - **API key parameter name**: oidc_auth_session - **Location**: + ### saml_auth - **Type**: API key diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index d9e2a76e6c2..f480b5b4c4d 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -50,7 +50,7 @@ paths: summary: setup communications preferences tags: - internal - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /setup_lakefs: get: @@ -110,7 +110,7 @@ paths: summary: setup lakeFS and create a first user tags: - internal - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /user: get: @@ -164,7 +164,7 @@ paths: summary: perform a login tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /auth/capabilities: get: @@ -282,7 +282,7 @@ paths: summary: create user tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /auth/users/{userId}: delete: @@ -448,7 +448,7 @@ paths: summary: create group tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /auth/groups/{groupId}: delete: @@ -621,7 +621,7 @@ paths: summary: create policy tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /auth/policies/{policyId}: delete: @@ -748,7 +748,7 @@ paths: summary: update policy tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /auth/groups/{groupId}/members: get: @@ -1501,7 +1501,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorNoACL' - description: Group not found, or group found but has no ACL + description: "Group not found, or group found but has no ACL" default: content: application/json: @@ -1552,7 +1552,7 @@ paths: summary: set ACL of group tags: - auth - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories: get: @@ -1611,8 +1611,8 @@ paths: post: operationId: createRepository parameters: - - description: If true, create a bare repository with no initial commit and - branch + - description: "If true, create a bare repository with no initial commit and\ + \ branch" explode: true in: query name: bare @@ -1661,7 +1661,7 @@ paths: summary: create repository tags: - repositories - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}: delete: @@ -1922,7 +1922,7 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error - summary: Dump repository refs (tags, commits, branches) to object store + summary: "Dump repository refs (tags, commits, branches) to object store" tags: - refs x-accepts: application/json @@ -1970,10 +1970,10 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error - summary: Restore repository refs (tags, commits, branches) from object store + summary: "Restore repository refs (tags, commits, branches) from object store" tags: - refs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/tags: get: @@ -2098,7 +2098,7 @@ paths: summary: create tag tags: - tags - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/tags/{tag}: delete: @@ -2312,7 +2312,7 @@ paths: summary: create branch tags: - branches - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/refs/{ref}/commits: get: @@ -2351,7 +2351,7 @@ paths: minimum: -1 type: integer style: form - - description: list of paths, each element is a path of a specific object + - description: "list of paths, each element is a path of a specific object" explode: true in: query name: objects @@ -2361,7 +2361,7 @@ paths: type: string type: array style: form - - description: list of paths, each element is a path of a prefix + - description: "list of paths, each element is a path of a prefix" explode: true in: query name: prefixes @@ -2380,8 +2380,8 @@ paths: schema: type: boolean style: form - - description: if set to true, follow only the first parent upon reaching a - merge commit + - description: "if set to true, follow only the first parent upon reaching a\ + \ merge commit" explode: true in: query name: first_parent @@ -2414,8 +2414,8 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error - summary: get commit log from ref. If both objects and prefixes are empty, return - all commits. + summary: "get commit log from ref. If both objects and prefixes are empty, return\ + \ all commits." tags: - refs x-accepts: application/json @@ -2498,7 +2498,7 @@ paths: summary: create commit tags: - commits - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}: delete: @@ -2642,7 +2642,7 @@ paths: summary: reset branch tags: - branches - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/revert: post: @@ -2704,7 +2704,7 @@ paths: summary: revert tags: - branches - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/cherry-pick: post: @@ -2770,7 +2770,7 @@ paths: summary: Replay the changes from the given commit on the branch tags: - branches - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: get: @@ -2919,7 +2919,7 @@ paths: summary: merge references tags: - refs - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/diff: get: @@ -3187,7 +3187,7 @@ paths: name: Range required: false schema: - pattern: ^bytes=((\d*-\d*,? ?)+)$ + pattern: "^bytes=((\\d*-\\d*,? ?)+)$" type: string style: simple - explode: true @@ -3239,7 +3239,7 @@ paths: Content-Range: explode: false schema: - pattern: ^bytes=((\d*-\d*,? ?)+)$ + pattern: "^bytes=((\\d*-\\d*,? ?)+)$" type: string style: simple Last-Modified: @@ -3327,7 +3327,7 @@ paths: name: Range required: false schema: - pattern: ^bytes=((\d*-\d*,? ?)+)$ + pattern: "^bytes=((\\d*-\\d*,? ?)+)$" type: string style: simple responses: @@ -3362,7 +3362,7 @@ paths: Content-Range: explode: false schema: - pattern: ^bytes=((\d*-\d*,? ?)+)$ + pattern: "^bytes=((\\d*-\\d*,? ?)+)$" type: string style: simple Last-Modified: @@ -3521,7 +3521,7 @@ paths: application/json: schema: $ref: '#/components/schemas/StagingLocation' - description: conflict with a commit, try here + description: "conflict with a commit, try here" default: content: application/json: @@ -3531,7 +3531,7 @@ paths: summary: associate staging on this physical address with a path tags: - staging - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/import: delete: @@ -3707,7 +3707,7 @@ paths: summary: import data from object store tags: - import - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/objects/stage_allowed: get: @@ -3868,16 +3868,10 @@ paths: type: string style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: multipart/form-data: schema: - properties: - content: - description: Only a single file per upload which must be named "content". - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadObject_request' application/octet-stream: schema: format: binary @@ -3928,7 +3922,7 @@ paths: tags: - objects x-validation-exclude-body: true - x-contentType: multipart/form-data + x-content-type: multipart/form-data x-accepts: application/json put: operationId: stageObject @@ -4001,7 +3995,7 @@ paths: summary: stage an object's metadata for the given branch tags: - objects - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/objects/delete: post: @@ -4061,7 +4055,7 @@ paths: summary: delete objects. Missing objects will not return a NotFound error. tags: - objects - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branches/{branch}/objects/copy: post: @@ -4130,7 +4124,7 @@ paths: summary: create a copy of an object tags: - objects - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/refs/{ref}/objects/stat: get: @@ -4917,7 +4911,7 @@ paths: description: Internal Server Error tags: - retention - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/gc/prepare_commits: post: @@ -5009,7 +5003,7 @@ paths: summary: save repository uncommitted metadata for garbage collection tags: - retention - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/branch_protection/set_allowed: get: @@ -5065,16 +5059,10 @@ paths: type: string style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: application/json: schema: - properties: - pattern: - type: string - required: - - pattern - type: object + $ref: '#/components/schemas/deleteBranchProtectionRule_request' required: true responses: "204": @@ -5099,7 +5087,7 @@ paths: description: Internal Server Error tags: - repositories - x-contentType: application/json + x-content-type: application/json x-accepts: application/json get: operationId: getBranchProtectionRules @@ -5181,7 +5169,7 @@ paths: description: Internal Server Error tags: - repositories - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /healthcheck: get: @@ -5284,10 +5272,10 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error - summary: post stats events, this endpoint is meant for internal use only + summary: "post stats events, this endpoint is meant for internal use only" tags: - internal - x-contentType: application/json + x-content-type: application/json x-accepts: application/json components: parameters: @@ -5330,28 +5318,13 @@ components: schema: type: string style: form - requestBodies: - inline_object_1: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_object_1' - required: true - inline_object: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object' - application/octet-stream: - schema: - $ref: '#/components/schemas/inline_object' responses: NotFoundOrNoACL: content: application/json: schema: $ref: '#/components/schemas/ErrorNoACL' - description: Group not found, or group found but has no ACL + description: "Group not found, or group found but has no ACL" Unauthorized: content: application/json: @@ -5520,7 +5493,7 @@ components: storage_namespace: s3://example-bucket/ properties: name: - pattern: ^[a-z0-9][a-z0-9-]{2,62}$ + pattern: "^[a-z0-9][a-z0-9-]{2,62}$" type: string storage_namespace: description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") @@ -5659,7 +5632,7 @@ components: description: path of the copied object relative to the ref type: string src_ref: - description: a reference, if empty uses the provided branch as ref + description: "a reference, if empty uses the provided branch as ref" type: string required: - src_path @@ -5805,7 +5778,7 @@ components: type: object OtfDiffEntry: example: - operation_content: '{}' + operation_content: "{}" operation_type: create id: id operation: operation @@ -5838,12 +5811,12 @@ components: example: diff_type: created results: - - operation_content: '{}' + - operation_content: "{}" operation_type: create id: id operation: operation timestamp: 0 - - operation_content: '{}' + - operation_content: "{}" operation_type: create id: id operation: operation @@ -5905,11 +5878,11 @@ components: parent_number: 0 properties: ref: - description: the commit to revert, given by a ref + description: "the commit to revert, given by a ref" type: string parent_number: - description: when reverting a merge commit, the parent number (starting - from 1) relative to which to perform the revert. + description: "when reverting a merge commit, the parent number (starting\ + \ from 1) relative to which to perform the revert." type: integer required: - parent_number @@ -5921,7 +5894,7 @@ components: parent_number: 0 properties: ref: - description: the commit to cherry-pick, given by a ref + description: "the commit to cherry-pick, given by a ref" type: string parent_number: description: | @@ -6046,10 +6019,10 @@ components: type: string type: object strategy: - description: In case of a merge conflict, this option will force the merge - process to automatically favor changes from the dest branch ('dest-wins') - or from the source branch('source-wins'). In case no selection is made, - the merge process will fail in case of a conflict + description: "In case of a merge conflict, this option will force the merge\ + \ process to automatically favor changes from the dest branch ('dest-wins')\ + \ or from the source branch('source-wins'). In case no selection is made,\ + \ the merge process will fail in case of a conflict" type: string type: object BranchCreation: @@ -6821,8 +6794,8 @@ components: description: opaque staging token to use to link uploaded object type: string presigned_url: - description: if presign=true is passed in the request, this field will contain - a pre-signed URL to use when uploading + description: "if presign=true is passed in the request, this field will\ + \ contain a pre-signed URL to use when uploading" nullable: true type: string presigned_url_expiry: @@ -6963,7 +6936,7 @@ components: pattern: stable_* properties: pattern: - description: fnmatch pattern for the branch name, supporting * and ? wildcards + description: "fnmatch pattern for the branch name, supporting * and ? wildcards" example: stable_* minLength: 1 type: string @@ -6973,7 +6946,7 @@ components: ImportLocation: properties: type: - description: Path type, can either be 'common_prefix' or 'object' + description: "Path type, can either be 'common_prefix' or 'object'" enum: - common_prefix - object @@ -7118,11 +7091,12 @@ components: class: class properties: class: - description: stats event class (e.g. "s3_gateway", "openapi_request", "experimental-feature", - "ui-event") + description: "stats event class (e.g. \"s3_gateway\", \"openapi_request\"\ + , \"experimental-feature\", \"ui-event\")" type: string name: - description: stats event name (e.g. "put_object", "create_repository", "") + description: "stats event name (e.g. \"put_object\", \"create_repository\"\ + , \"\")" type: string count: description: number of events of the class and name @@ -7149,14 +7123,14 @@ components: required: - events type: object - inline_object: + uploadObject_request: properties: content: description: Only a single file per upload which must be named "content". format: binary type: string type: object - inline_object_1: + deleteBranchProtectionRule_request: properties: pattern: type: string diff --git a/clients/java/build.gradle b/clients/java/build.gradle index ffef9fffd9a..6dbec5dbdef 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' group = 'io.lakefs' version = '0.1.0-SNAPSHOT' @@ -11,7 +12,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -63,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -87,7 +89,7 @@ if(hasProperty('target') && target == 'android') { publishing { publications { maven(MavenPublication) { - artifactId = 'api-client' + artifactId = 'sdk-client' from components.java } } @@ -104,20 +106,63 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/clients/java/build.sbt b/clients/java/build.sbt index c2bb424c99d..843e6b7106e 100644 --- a/clients/java/build.sbt +++ b/clients/java/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( organization := "io.lakefs", - name := "api-client", + name := "sdk-client", version := "0.1.0-SNAPSHOT", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), @@ -9,18 +9,20 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/clients/java/docs/ACL.md b/clients/java/docs/ACL.md index 549df7fe41b..c0b11e34916 100644 --- a/clients/java/docs/ACL.md +++ b/clients/java/docs/ACL.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**permission** | **String** | Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permission** | **String** | Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. | | diff --git a/clients/java/docs/AccessKeyCredentials.md b/clients/java/docs/AccessKeyCredentials.md index 9cf893ec2e1..097e4db0c20 100644 --- a/clients/java/docs/AccessKeyCredentials.md +++ b/clients/java/docs/AccessKeyCredentials.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessKeyId** | **String** | access key ID to set for user for use in integration testing. | -**secretAccessKey** | **String** | secret access key to set for user for use in integration testing. | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | access key ID to set for user for use in integration testing. | | +|**secretAccessKey** | **String** | secret access key to set for user for use in integration testing. | | diff --git a/clients/java/docs/ActionRun.md b/clients/java/docs/ActionRun.md index 799b04a9449..935b53e48e3 100644 --- a/clients/java/docs/ActionRun.md +++ b/clients/java/docs/ActionRun.md @@ -5,24 +5,24 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runId** | **String** | | -**branch** | **String** | | -**startTime** | **OffsetDateTime** | | -**endTime** | **OffsetDateTime** | | [optional] -**eventType** | **String** | | -**status** | [**StatusEnum**](#StatusEnum) | | -**commitId** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**runId** | **String** | | | +|**branch** | **String** | | | +|**startTime** | **OffsetDateTime** | | | +|**endTime** | **OffsetDateTime** | | [optional] | +|**eventType** | **String** | | | +|**status** | [**StatusEnum**](#StatusEnum) | | | +|**commitId** | **String** | | | ## Enum: StatusEnum -Name | Value ----- | ----- -FAILED | "failed" -COMPLETED | "completed" +| Name | Value | +|---- | -----| +| FAILED | "failed" | +| COMPLETED | "completed" | diff --git a/clients/java/docs/ActionRunList.md b/clients/java/docs/ActionRunList.md index 6e284fd2f39..0a0f19c7dbc 100644 --- a/clients/java/docs/ActionRunList.md +++ b/clients/java/docs/ActionRunList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<ActionRun>**](ActionRun.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<ActionRun>**](ActionRun.md) | | | diff --git a/clients/java/docs/ActionsApi.md b/clients/java/docs/ActionsApi.md index 605ec132a32..bb6c11269ab 100644 --- a/clients/java/docs/ActionsApi.md +++ b/clients/java/docs/ActionsApi.md @@ -1,35 +1,35 @@ # ActionsApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getRun**](ActionsApi.md#getRun) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run -[**getRunHookOutput**](ActionsApi.md#getRunHookOutput) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output -[**listRepositoryRuns**](ActionsApi.md#listRepositoryRuns) | **GET** /repositories/{repository}/actions/runs | list runs -[**listRunHooks**](ActionsApi.md#listRunHooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getRun**](ActionsApi.md#getRun) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run | +| [**getRunHookOutput**](ActionsApi.md#getRunHookOutput) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output | +| [**listRepositoryRuns**](ActionsApi.md#listRepositoryRuns) | **GET** /repositories/{repository}/actions/runs | list runs | +| [**listRunHooks**](ActionsApi.md#listRunHooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks | - + # **getRun** -> ActionRun getRun(repository, runId) +> ActionRun getRun(repository, runId).execute(); get a run ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ActionsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ActionsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -42,10 +42,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -58,11 +54,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ActionsApi apiInstance = new ActionsApi(defaultClient); String repository = "repository_example"; // String | String runId = "runId_example"; // String | try { - ActionRun result = apiInstance.getRun(repository, runId); + ActionRun result = apiInstance.getRun(repository, runId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ActionsApi#getRun"); @@ -77,10 +78,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **runId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **runId** | **String**| | | ### Return type @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -98,31 +99,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | action run result | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | action run result | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getRunHookOutput** -> File getRunHookOutput(repository, runId, hookRunId) +> File getRunHookOutput(repository, runId, hookRunId).execute(); get run hook output ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ActionsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ActionsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -135,10 +136,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -151,12 +148,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ActionsApi apiInstance = new ActionsApi(defaultClient); String repository = "repository_example"; // String | String runId = "runId_example"; // String | String hookRunId = "hookRunId_example"; // String | try { - File result = apiInstance.getRunHookOutput(repository, runId, hookRunId); + File result = apiInstance.getRunHookOutput(repository, runId, hookRunId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ActionsApi#getRunHookOutput"); @@ -171,11 +173,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **runId** | **String**| | - **hookRunId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **runId** | **String**| | | +| **hookRunId** | **String**| | | ### Return type @@ -183,7 +185,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -193,31 +195,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | run hook output | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | run hook output | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listRepositoryRuns** -> ActionRunList listRepositoryRuns(repository, after, amount, branch, commit) +> ActionRunList listRepositoryRuns(repository).after(after).amount(amount).branch(branch).commit(commit).execute(); list runs ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ActionsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ActionsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -230,10 +232,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -246,6 +244,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ActionsApi apiInstance = new ActionsApi(defaultClient); String repository = "repository_example"; // String | String after = "after_example"; // String | return items after this value @@ -253,7 +255,12 @@ public class Example { String branch = "branch_example"; // String | String commit = "commit_example"; // String | try { - ActionRunList result = apiInstance.listRepositoryRuns(repository, after, amount, branch, commit); + ActionRunList result = apiInstance.listRepositoryRuns(repository) + .after(after) + .amount(amount) + .branch(branch) + .commit(commit) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ActionsApi#listRepositoryRuns"); @@ -268,13 +275,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **branch** | **String**| | [optional] - **commit** | **String**| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **branch** | **String**| | [optional] | +| **commit** | **String**| | [optional] | ### Return type @@ -282,7 +289,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -292,31 +299,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | list action runs | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | list action runs | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listRunHooks** -> HookRunList listRunHooks(repository, runId, after, amount) +> HookRunList listRunHooks(repository, runId).after(after).amount(amount).execute(); list run hooks ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ActionsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ActionsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -329,10 +336,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -345,13 +348,20 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ActionsApi apiInstance = new ActionsApi(defaultClient); String repository = "repository_example"; // String | String runId = "runId_example"; // String | String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - HookRunList result = apiInstance.listRunHooks(repository, runId, after, amount); + HookRunList result = apiInstance.listRunHooks(repository, runId) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ActionsApi#listRunHooks"); @@ -366,12 +376,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **runId** | **String**| | - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **runId** | **String**| | | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -379,7 +389,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -389,8 +399,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | list specific run hooks | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | list specific run hooks | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/AuthApi.md b/clients/java/docs/AuthApi.md index 955bdd8a725..3b7a2ee58c0 100644 --- a/clients/java/docs/AuthApi.md +++ b/clients/java/docs/AuthApi.md @@ -1,62 +1,62 @@ # AuthApi -All URIs are relative to *http://localhost/api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addGroupMembership**](AuthApi.md#addGroupMembership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership -[**attachPolicyToGroup**](AuthApi.md#attachPolicyToGroup) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group -[**attachPolicyToUser**](AuthApi.md#attachPolicyToUser) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user -[**createCredentials**](AuthApi.md#createCredentials) | **POST** /auth/users/{userId}/credentials | create credentials -[**createGroup**](AuthApi.md#createGroup) | **POST** /auth/groups | create group -[**createPolicy**](AuthApi.md#createPolicy) | **POST** /auth/policies | create policy -[**createUser**](AuthApi.md#createUser) | **POST** /auth/users | create user -[**deleteCredentials**](AuthApi.md#deleteCredentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials -[**deleteGroup**](AuthApi.md#deleteGroup) | **DELETE** /auth/groups/{groupId} | delete group -[**deleteGroupMembership**](AuthApi.md#deleteGroupMembership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership -[**deletePolicy**](AuthApi.md#deletePolicy) | **DELETE** /auth/policies/{policyId} | delete policy -[**deleteUser**](AuthApi.md#deleteUser) | **DELETE** /auth/users/{userId} | delete user -[**detachPolicyFromGroup**](AuthApi.md#detachPolicyFromGroup) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group -[**detachPolicyFromUser**](AuthApi.md#detachPolicyFromUser) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user -[**getCredentials**](AuthApi.md#getCredentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials -[**getCurrentUser**](AuthApi.md#getCurrentUser) | **GET** /user | get current user -[**getGroup**](AuthApi.md#getGroup) | **GET** /auth/groups/{groupId} | get group -[**getGroupACL**](AuthApi.md#getGroupACL) | **GET** /auth/groups/{groupId}/acl | get ACL of group -[**getPolicy**](AuthApi.md#getPolicy) | **GET** /auth/policies/{policyId} | get policy -[**getUser**](AuthApi.md#getUser) | **GET** /auth/users/{userId} | get user -[**listGroupMembers**](AuthApi.md#listGroupMembers) | **GET** /auth/groups/{groupId}/members | list group members -[**listGroupPolicies**](AuthApi.md#listGroupPolicies) | **GET** /auth/groups/{groupId}/policies | list group policies -[**listGroups**](AuthApi.md#listGroups) | **GET** /auth/groups | list groups -[**listPolicies**](AuthApi.md#listPolicies) | **GET** /auth/policies | list policies -[**listUserCredentials**](AuthApi.md#listUserCredentials) | **GET** /auth/users/{userId}/credentials | list user credentials -[**listUserGroups**](AuthApi.md#listUserGroups) | **GET** /auth/users/{userId}/groups | list user groups -[**listUserPolicies**](AuthApi.md#listUserPolicies) | **GET** /auth/users/{userId}/policies | list user policies -[**listUsers**](AuthApi.md#listUsers) | **GET** /auth/users | list users -[**login**](AuthApi.md#login) | **POST** /auth/login | perform a login -[**setGroupACL**](AuthApi.md#setGroupACL) | **POST** /auth/groups/{groupId}/acl | set ACL of group -[**updatePolicy**](AuthApi.md#updatePolicy) | **PUT** /auth/policies/{policyId} | update policy - - - +All URIs are relative to */api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addGroupMembership**](AuthApi.md#addGroupMembership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership | +| [**attachPolicyToGroup**](AuthApi.md#attachPolicyToGroup) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group | +| [**attachPolicyToUser**](AuthApi.md#attachPolicyToUser) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user | +| [**createCredentials**](AuthApi.md#createCredentials) | **POST** /auth/users/{userId}/credentials | create credentials | +| [**createGroup**](AuthApi.md#createGroup) | **POST** /auth/groups | create group | +| [**createPolicy**](AuthApi.md#createPolicy) | **POST** /auth/policies | create policy | +| [**createUser**](AuthApi.md#createUser) | **POST** /auth/users | create user | +| [**deleteCredentials**](AuthApi.md#deleteCredentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials | +| [**deleteGroup**](AuthApi.md#deleteGroup) | **DELETE** /auth/groups/{groupId} | delete group | +| [**deleteGroupMembership**](AuthApi.md#deleteGroupMembership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership | +| [**deletePolicy**](AuthApi.md#deletePolicy) | **DELETE** /auth/policies/{policyId} | delete policy | +| [**deleteUser**](AuthApi.md#deleteUser) | **DELETE** /auth/users/{userId} | delete user | +| [**detachPolicyFromGroup**](AuthApi.md#detachPolicyFromGroup) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group | +| [**detachPolicyFromUser**](AuthApi.md#detachPolicyFromUser) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user | +| [**getCredentials**](AuthApi.md#getCredentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials | +| [**getCurrentUser**](AuthApi.md#getCurrentUser) | **GET** /user | get current user | +| [**getGroup**](AuthApi.md#getGroup) | **GET** /auth/groups/{groupId} | get group | +| [**getGroupACL**](AuthApi.md#getGroupACL) | **GET** /auth/groups/{groupId}/acl | get ACL of group | +| [**getPolicy**](AuthApi.md#getPolicy) | **GET** /auth/policies/{policyId} | get policy | +| [**getUser**](AuthApi.md#getUser) | **GET** /auth/users/{userId} | get user | +| [**listGroupMembers**](AuthApi.md#listGroupMembers) | **GET** /auth/groups/{groupId}/members | list group members | +| [**listGroupPolicies**](AuthApi.md#listGroupPolicies) | **GET** /auth/groups/{groupId}/policies | list group policies | +| [**listGroups**](AuthApi.md#listGroups) | **GET** /auth/groups | list groups | +| [**listPolicies**](AuthApi.md#listPolicies) | **GET** /auth/policies | list policies | +| [**listUserCredentials**](AuthApi.md#listUserCredentials) | **GET** /auth/users/{userId}/credentials | list user credentials | +| [**listUserGroups**](AuthApi.md#listUserGroups) | **GET** /auth/users/{userId}/groups | list user groups | +| [**listUserPolicies**](AuthApi.md#listUserPolicies) | **GET** /auth/users/{userId}/policies | list user policies | +| [**listUsers**](AuthApi.md#listUsers) | **GET** /auth/users | list users | +| [**login**](AuthApi.md#login) | **POST** /auth/login | perform a login | +| [**setGroupACL**](AuthApi.md#setGroupACL) | **POST** /auth/groups/{groupId}/acl | set ACL of group | +| [**updatePolicy**](AuthApi.md#updatePolicy) | **PUT** /auth/policies/{policyId} | update policy | + + + # **addGroupMembership** -> addGroupMembership(groupId, userId) +> addGroupMembership(groupId, userId).execute(); add group membership ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -69,10 +69,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -85,11 +81,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String userId = "userId_example"; // String | try { - apiInstance.addGroupMembership(groupId, userId); + apiInstance.addGroupMembership(groupId, userId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#addGroupMembership"); System.err.println("Status code: " + e.getCode()); @@ -103,10 +104,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **userId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **userId** | **String**| | | ### Return type @@ -114,7 +115,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -124,31 +125,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | membership added successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | membership added successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **attachPolicyToGroup** -> attachPolicyToGroup(groupId, policyId) +> attachPolicyToGroup(groupId, policyId).execute(); attach policy to group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -161,10 +162,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -177,11 +174,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String policyId = "policyId_example"; // String | try { - apiInstance.attachPolicyToGroup(groupId, policyId); + apiInstance.attachPolicyToGroup(groupId, policyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#attachPolicyToGroup"); System.err.println("Status code: " + e.getCode()); @@ -195,10 +197,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **policyId** | **String**| | | ### Return type @@ -206,7 +208,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -216,31 +218,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | policy attached successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | policy attached successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **attachPolicyToUser** -> attachPolicyToUser(userId, policyId) +> attachPolicyToUser(userId, policyId).execute(); attach policy to user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -253,10 +255,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -269,11 +267,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String policyId = "policyId_example"; // String | try { - apiInstance.attachPolicyToUser(userId, policyId); + apiInstance.attachPolicyToUser(userId, policyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#attachPolicyToUser"); System.err.println("Status code: " + e.getCode()); @@ -287,10 +290,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **policyId** | **String**| | | ### Return type @@ -298,7 +301,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -308,31 +311,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | policy attached successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | policy attached successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **createCredentials** -> CredentialsWithSecret createCredentials(userId) +> CredentialsWithSecret createCredentials(userId).execute(); create credentials ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -345,10 +348,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -361,10 +360,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | try { - CredentialsWithSecret result = apiInstance.createCredentials(userId); + CredentialsWithSecret result = apiInstance.createCredentials(userId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#createCredentials"); @@ -379,9 +383,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | ### Return type @@ -389,7 +393,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -399,31 +403,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | credentials | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | credentials | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **createGroup** -> Group createGroup(groupCreation) +> Group createGroup().groupCreation(groupCreation).execute(); create group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -436,10 +440,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -452,10 +452,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); GroupCreation groupCreation = new GroupCreation(); // GroupCreation | try { - Group result = apiInstance.createGroup(groupCreation); + Group result = apiInstance.createGroup() + .groupCreation(groupCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#createGroup"); @@ -470,9 +476,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupCreation** | [**GroupCreation**](GroupCreation.md)| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupCreation** | [**GroupCreation**](GroupCreation.md)| | [optional] | ### Return type @@ -480,7 +486,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -490,31 +496,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | group | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | group | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **createPolicy** -> Policy createPolicy(policy) +> Policy createPolicy(policy).execute(); create policy ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -527,10 +533,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -543,10 +545,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); Policy policy = new Policy(); // Policy | try { - Policy result = apiInstance.createPolicy(policy); + Policy result = apiInstance.createPolicy(policy) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#createPolicy"); @@ -561,9 +568,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policy** | [**Policy**](Policy.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policy** | [**Policy**](Policy.md)| | | ### Return type @@ -571,7 +578,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -581,32 +588,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | policy | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | +| **201** | policy | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | - + # **createUser** -> User createUser(userCreation) +> User createUser().userCreation(userCreation).execute(); create user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -619,10 +626,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -635,10 +638,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); UserCreation userCreation = new UserCreation(); // UserCreation | try { - User result = apiInstance.createUser(userCreation); + User result = apiInstance.createUser() + .userCreation(userCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#createUser"); @@ -653,9 +662,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userCreation** | [**UserCreation**](UserCreation.md)| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userCreation** | [**UserCreation**](UserCreation.md)| | [optional] | ### Return type @@ -663,7 +672,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -673,32 +682,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | user | - | -**400** | validation error | - | -**401** | Unauthorized | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | +| **201** | user | - | +| **400** | validation error | - | +| **401** | Unauthorized | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | - + # **deleteCredentials** -> deleteCredentials(userId, accessKeyId) +> deleteCredentials(userId, accessKeyId).execute(); delete credentials ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -711,10 +720,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -727,11 +732,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String accessKeyId = "accessKeyId_example"; // String | try { - apiInstance.deleteCredentials(userId, accessKeyId); + apiInstance.deleteCredentials(userId, accessKeyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#deleteCredentials"); System.err.println("Status code: " + e.getCode()); @@ -745,10 +755,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **accessKeyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **accessKeyId** | **String**| | | ### Return type @@ -756,7 +766,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -766,31 +776,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | credentials deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | credentials deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteGroup** -> deleteGroup(groupId) +> deleteGroup(groupId).execute(); delete group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -803,10 +813,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -819,10 +825,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | try { - apiInstance.deleteGroup(groupId); + apiInstance.deleteGroup(groupId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#deleteGroup"); System.err.println("Status code: " + e.getCode()); @@ -836,9 +847,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | ### Return type @@ -846,7 +857,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -856,31 +867,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | group deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | group deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteGroupMembership** -> deleteGroupMembership(groupId, userId) +> deleteGroupMembership(groupId, userId).execute(); delete group membership ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -893,10 +904,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -909,11 +916,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String userId = "userId_example"; // String | try { - apiInstance.deleteGroupMembership(groupId, userId); + apiInstance.deleteGroupMembership(groupId, userId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#deleteGroupMembership"); System.err.println("Status code: " + e.getCode()); @@ -927,10 +939,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **userId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **userId** | **String**| | | ### Return type @@ -938,7 +950,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -948,31 +960,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | membership deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | membership deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deletePolicy** -> deletePolicy(policyId) +> deletePolicy(policyId).execute(); delete policy ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -985,10 +997,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1001,10 +1009,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String policyId = "policyId_example"; // String | try { - apiInstance.deletePolicy(policyId); + apiInstance.deletePolicy(policyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#deletePolicy"); System.err.println("Status code: " + e.getCode()); @@ -1018,9 +1031,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyId** | **String**| | | ### Return type @@ -1028,7 +1041,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1038,31 +1051,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | policy deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | policy deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteUser** -> deleteUser(userId) +> deleteUser(userId).execute(); delete user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1075,10 +1088,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1091,10 +1100,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | try { - apiInstance.deleteUser(userId); + apiInstance.deleteUser(userId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#deleteUser"); System.err.println("Status code: " + e.getCode()); @@ -1108,9 +1122,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | ### Return type @@ -1118,7 +1132,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1128,31 +1142,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | user deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | user deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **detachPolicyFromGroup** -> detachPolicyFromGroup(groupId, policyId) +> detachPolicyFromGroup(groupId, policyId).execute(); detach policy from group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1165,10 +1179,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1181,11 +1191,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String policyId = "policyId_example"; // String | try { - apiInstance.detachPolicyFromGroup(groupId, policyId); + apiInstance.detachPolicyFromGroup(groupId, policyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#detachPolicyFromGroup"); System.err.println("Status code: " + e.getCode()); @@ -1199,10 +1214,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **policyId** | **String**| | | ### Return type @@ -1210,7 +1225,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1220,31 +1235,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | policy detached successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | policy detached successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **detachPolicyFromUser** -> detachPolicyFromUser(userId, policyId) +> detachPolicyFromUser(userId, policyId).execute(); detach policy from user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1257,10 +1272,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1273,11 +1284,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String policyId = "policyId_example"; // String | try { - apiInstance.detachPolicyFromUser(userId, policyId); + apiInstance.detachPolicyFromUser(userId, policyId) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#detachPolicyFromUser"); System.err.println("Status code: " + e.getCode()); @@ -1291,10 +1307,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **policyId** | **String**| | | ### Return type @@ -1302,7 +1318,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1312,31 +1328,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | policy detached successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | policy detached successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getCredentials** -> Credentials getCredentials(userId, accessKeyId) +> Credentials getCredentials(userId, accessKeyId).execute(); get credentials ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1349,10 +1365,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1365,11 +1377,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String accessKeyId = "accessKeyId_example"; // String | try { - Credentials result = apiInstance.getCredentials(userId, accessKeyId); + Credentials result = apiInstance.getCredentials(userId, accessKeyId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getCredentials"); @@ -1384,10 +1401,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **accessKeyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **accessKeyId** | **String**| | | ### Return type @@ -1395,7 +1412,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1405,31 +1422,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | credentials | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | credentials | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getCurrentUser** -> CurrentUser getCurrentUser() +> CurrentUser getCurrentUser().execute(); get current user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1442,10 +1459,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1458,9 +1471,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); try { - CurrentUser result = apiInstance.getCurrentUser(); + CurrentUser result = apiInstance.getCurrentUser() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getCurrentUser"); @@ -1482,7 +1500,7 @@ This endpoint does not need any parameter. ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1492,28 +1510,28 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | user | - | +| **200** | user | - | - + # **getGroup** -> Group getGroup(groupId) +> Group getGroup(groupId).execute(); get group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1526,10 +1544,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1542,10 +1556,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | try { - Group result = apiInstance.getGroup(groupId); + Group result = apiInstance.getGroup(groupId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getGroup"); @@ -1560,9 +1579,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | ### Return type @@ -1570,7 +1589,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1580,31 +1599,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | group | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | group | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getGroupACL** -> ACL getGroupACL(groupId) +> ACL getGroupACL(groupId).execute(); get ACL of group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1617,10 +1636,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1633,10 +1648,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | try { - ACL result = apiInstance.getGroupACL(groupId); + ACL result = apiInstance.getGroupACL(groupId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getGroupACL"); @@ -1651,9 +1671,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | ### Return type @@ -1661,7 +1681,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1671,31 +1691,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | ACL of group | - | -**401** | Unauthorized | - | -**404** | Group not found, or group found but has no ACL | - | -**0** | Internal Server Error | - | +| **200** | ACL of group | - | +| **401** | Unauthorized | - | +| **404** | Group not found, or group found but has no ACL | - | +| **0** | Internal Server Error | - | - + # **getPolicy** -> Policy getPolicy(policyId) +> Policy getPolicy(policyId).execute(); get policy ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1708,10 +1728,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1724,10 +1740,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String policyId = "policyId_example"; // String | try { - Policy result = apiInstance.getPolicy(policyId); + Policy result = apiInstance.getPolicy(policyId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getPolicy"); @@ -1742,9 +1763,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyId** | **String**| | | ### Return type @@ -1752,7 +1773,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1762,31 +1783,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | policy | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | policy | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getUser** -> User getUser(userId) +> User getUser(userId).execute(); get user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1799,10 +1820,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1815,10 +1832,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | try { - User result = apiInstance.getUser(userId); + User result = apiInstance.getUser(userId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#getUser"); @@ -1833,9 +1855,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | ### Return type @@ -1843,7 +1865,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1853,31 +1875,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | user | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | user | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listGroupMembers** -> UserList listGroupMembers(groupId, prefix, after, amount) +> UserList listGroupMembers(groupId).prefix(prefix).after(after).amount(amount).execute(); list group members ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1890,10 +1912,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -1906,13 +1924,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - UserList result = apiInstance.listGroupMembers(groupId, prefix, after, amount); + UserList result = apiInstance.listGroupMembers(groupId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listGroupMembers"); @@ -1927,12 +1953,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -1940,7 +1966,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1950,30 +1976,30 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | group member list | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | group member list | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **listGroupPolicies** -> PolicyList listGroupPolicies(groupId, prefix, after, amount) +> PolicyList listGroupPolicies(groupId).prefix(prefix).after(after).amount(amount).execute(); list group policies ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -1986,10 +2012,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2002,13 +2024,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - PolicyList result = apiInstance.listGroupPolicies(groupId, prefix, after, amount); + PolicyList result = apiInstance.listGroupPolicies(groupId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listGroupPolicies"); @@ -2023,12 +2053,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2036,7 +2066,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2046,31 +2076,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | policy list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | policy list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listGroups** -> GroupList listGroups(prefix, after, amount) +> GroupList listGroups().prefix(prefix).after(after).amount(amount).execute(); list groups ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2083,10 +2113,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2099,12 +2125,20 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - GroupList result = apiInstance.listGroups(prefix, after, amount); + GroupList result = apiInstance.listGroups() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listGroups"); @@ -2119,11 +2153,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2131,7 +2165,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2141,30 +2175,30 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | group list | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | group list | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **listPolicies** -> PolicyList listPolicies(prefix, after, amount) +> PolicyList listPolicies().prefix(prefix).after(after).amount(amount).execute(); list policies ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2177,10 +2211,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2193,12 +2223,20 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - PolicyList result = apiInstance.listPolicies(prefix, after, amount); + PolicyList result = apiInstance.listPolicies() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listPolicies"); @@ -2213,11 +2251,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2225,7 +2263,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2235,30 +2273,30 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | policy list | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | policy list | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **listUserCredentials** -> CredentialsList listUserCredentials(userId, prefix, after, amount) +> CredentialsList listUserCredentials(userId).prefix(prefix).after(after).amount(amount).execute(); list user credentials ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2271,10 +2309,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2287,13 +2321,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - CredentialsList result = apiInstance.listUserCredentials(userId, prefix, after, amount); + CredentialsList result = apiInstance.listUserCredentials(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listUserCredentials"); @@ -2308,12 +2350,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2321,7 +2363,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2331,31 +2373,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | credential list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | credential list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listUserGroups** -> GroupList listUserGroups(userId, prefix, after, amount) +> GroupList listUserGroups(userId).prefix(prefix).after(after).amount(amount).execute(); list user groups ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2368,10 +2410,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2384,13 +2422,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - GroupList result = apiInstance.listUserGroups(userId, prefix, after, amount); + GroupList result = apiInstance.listUserGroups(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listUserGroups"); @@ -2405,12 +2451,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2418,7 +2464,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2428,31 +2474,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | group list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | group list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listUserPolicies** -> PolicyList listUserPolicies(userId, prefix, after, amount, effective) +> PolicyList listUserPolicies(userId).prefix(prefix).after(after).amount(amount).effective(effective).execute(); list user policies ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2465,10 +2511,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2481,6 +2523,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String userId = "userId_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value @@ -2488,7 +2534,12 @@ public class Example { Integer amount = 100; // Integer | how many items to return Boolean effective = false; // Boolean | will return all distinct policies attached to the user or any of its groups try { - PolicyList result = apiInstance.listUserPolicies(userId, prefix, after, amount, effective); + PolicyList result = apiInstance.listUserPolicies(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .effective(effective) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listUserPolicies"); @@ -2503,13 +2554,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **effective** | **Boolean**| will return all distinct policies attached to the user or any of its groups | [optional] [default to false] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **effective** | **Boolean**| will return all distinct policies attached to the user or any of its groups | [optional] [default to false] | ### Return type @@ -2517,7 +2568,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2527,31 +2578,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | policy list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | policy list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listUsers** -> UserList listUsers(prefix, after, amount) +> UserList listUsers().prefix(prefix).after(after).amount(amount).execute(); list users ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2564,10 +2615,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2580,12 +2627,20 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - UserList result = apiInstance.listUsers(prefix, after, amount); + UserList result = apiInstance.listUsers() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#listUsers"); @@ -2600,11 +2655,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -2612,7 +2667,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2622,34 +2677,36 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | user list | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | user list | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **login** -> AuthenticationToken login(loginInformation) +> AuthenticationToken login().loginInformation(loginInformation).execute(); perform a login ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); AuthApi apiInstance = new AuthApi(defaultClient); LoginInformation loginInformation = new LoginInformation(); // LoginInformation | try { - AuthenticationToken result = apiInstance.login(loginInformation); + AuthenticationToken result = apiInstance.login() + .loginInformation(loginInformation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#login"); @@ -2664,9 +2721,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loginInformation** | [**LoginInformation**](LoginInformation.md)| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **loginInformation** | [**LoginInformation**](LoginInformation.md)| | [optional] | ### Return type @@ -2684,30 +2741,30 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful login | * Set-Cookie -
| -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | successful login | * Set-Cookie -
| +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **setGroupACL** -> setGroupACL(groupId, ACL) +> setGroupACL(groupId, ACL).execute(); set ACL of group ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2720,10 +2777,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2736,11 +2789,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String groupId = "groupId_example"; // String | ACL ACL = new ACL(); // ACL | try { - apiInstance.setGroupACL(groupId, ACL); + apiInstance.setGroupACL(groupId, ACL) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#setGroupACL"); System.err.println("Status code: " + e.getCode()); @@ -2754,10 +2812,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **String**| | - **ACL** | [**ACL**](ACL.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | **String**| | | +| **ACL** | [**ACL**](ACL.md)| | | ### Return type @@ -2765,7 +2823,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2775,31 +2833,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | ACL successfully changed | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | ACL successfully changed | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **updatePolicy** -> Policy updatePolicy(policyId, policy) +> Policy updatePolicy(policyId, policy).execute(); update policy ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.AuthApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.AuthApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -2812,10 +2870,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -2828,11 +2882,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + AuthApi apiInstance = new AuthApi(defaultClient); String policyId = "policyId_example"; // String | Policy policy = new Policy(); // Policy | try { - Policy result = apiInstance.updatePolicy(policyId, policy); + Policy result = apiInstance.updatePolicy(policyId, policy) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthApi#updatePolicy"); @@ -2847,10 +2906,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **String**| | - **policy** | [**Policy**](Policy.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **policyId** | **String**| | | +| **policy** | [**Policy**](Policy.md)| | | ### Return type @@ -2858,7 +2917,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -2868,9 +2927,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | policy | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | policy | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/AuthCapabilities.md b/clients/java/docs/AuthCapabilities.md index 664d2ccb8fd..a7be5b502c9 100644 --- a/clients/java/docs/AuthCapabilities.md +++ b/clients/java/docs/AuthCapabilities.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inviteUser** | **Boolean** | | [optional] -**forgotPassword** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**inviteUser** | **Boolean** | | [optional] | +|**forgotPassword** | **Boolean** | | [optional] | diff --git a/clients/java/docs/AuthenticationToken.md b/clients/java/docs/AuthenticationToken.md index 826f4e3c6e5..1adb437b3c9 100644 --- a/clients/java/docs/AuthenticationToken.md +++ b/clients/java/docs/AuthenticationToken.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | **String** | a JWT token that could be used to authenticate requests | -**tokenExpiration** | **Long** | Unix Epoch in seconds | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**token** | **String** | a JWT token that could be used to authenticate requests | | +|**tokenExpiration** | **Long** | Unix Epoch in seconds | [optional] | diff --git a/clients/java/docs/BranchCreation.md b/clients/java/docs/BranchCreation.md index 7687d5a7422..eb248dcc39b 100644 --- a/clients/java/docs/BranchCreation.md +++ b/clients/java/docs/BranchCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | -**source** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**source** | **String** | | | diff --git a/clients/java/docs/BranchProtectionRule.md b/clients/java/docs/BranchProtectionRule.md index 28153739a93..c5d46a97549 100644 --- a/clients/java/docs/BranchProtectionRule.md +++ b/clients/java/docs/BranchProtectionRule.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pattern** | **String** | fnmatch pattern for the branch name, supporting * and ? wildcards | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pattern** | **String** | fnmatch pattern for the branch name, supporting * and ? wildcards | | diff --git a/clients/java/docs/BranchesApi.md b/clients/java/docs/BranchesApi.md index ffbbde2ee2a..9b26deae8ae 100644 --- a/clients/java/docs/BranchesApi.md +++ b/clients/java/docs/BranchesApi.md @@ -1,39 +1,39 @@ # BranchesApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Replay the changes from the given commit on the branch -[**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch -[**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch -[**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch -[**getBranch**](BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch -[**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches -[**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch -[**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Replay the changes from the given commit on the branch | +| [**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch | +| [**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch | +| [**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch | +| [**getBranch**](BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch | +| [**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches | +| [**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch | +| [**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert | - + # **cherryPick** -> Commit cherryPick(repository, branch, cherryPickCreation) +> Commit cherryPick(repository, branch, cherryPickCreation).execute(); Replay the changes from the given commit on the branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -46,10 +46,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -62,12 +58,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | CherryPickCreation cherryPickCreation = new CherryPickCreation(); // CherryPickCreation | try { - Commit result = apiInstance.cherryPick(repository, branch, cherryPickCreation); + Commit result = apiInstance.cherryPick(repository, branch, cherryPickCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#cherryPick"); @@ -82,11 +83,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | | ### Return type @@ -94,7 +95,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -104,33 +105,33 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | the cherry-pick commit | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Conflict Found | - | -**0** | Internal Server Error | - | - - +| **201** | the cherry-pick commit | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Conflict Found | - | +| **0** | Internal Server Error | - | + + # **createBranch** -> String createBranch(repository, branchCreation) +> String createBranch(repository, branchCreation).execute(); create branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -143,10 +144,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -159,11 +156,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | BranchCreation branchCreation = new BranchCreation(); // BranchCreation | try { - String result = apiInstance.createBranch(repository, branchCreation); + String result = apiInstance.createBranch(repository, branchCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#createBranch"); @@ -178,10 +180,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branchCreation** | [**BranchCreation**](BranchCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branchCreation** | [**BranchCreation**](BranchCreation.md)| | | ### Return type @@ -189,7 +191,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -199,33 +201,33 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | reference | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | - - +| **201** | reference | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | + + # **deleteBranch** -> deleteBranch(repository, branch) +> deleteBranch(repository, branch).execute(); delete branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -238,10 +240,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -254,11 +252,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | try { - apiInstance.deleteBranch(repository, branch); + apiInstance.deleteBranch(repository, branch) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#deleteBranch"); System.err.println("Status code: " + e.getCode()); @@ -272,10 +275,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | ### Return type @@ -283,7 +286,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -293,32 +296,32 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | branch deleted successfully | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | branch deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **diffBranch** -> DiffList diffBranch(repository, branch, after, amount, prefix, delimiter) +> DiffList diffBranch(repository, branch).after(after).amount(amount).prefix(prefix).delimiter(delimiter).execute(); diff branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -331,10 +334,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -347,6 +346,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | @@ -355,7 +358,12 @@ public class Example { String prefix = "prefix_example"; // String | return items prefixed with this value String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by try { - DiffList result = apiInstance.diffBranch(repository, branch, after, amount, prefix, delimiter); + DiffList result = apiInstance.diffBranch(repository, branch) + .after(after) + .amount(amount) + .prefix(prefix) + .delimiter(delimiter) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#diffBranch"); @@ -370,14 +378,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **prefix** | **String**| return items prefixed with this value | [optional] - **delimiter** | **String**| delimiter used to group common prefixes by | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **delimiter** | **String**| delimiter used to group common prefixes by | [optional] | ### Return type @@ -385,7 +393,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -395,31 +403,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | diff of branch uncommitted changes | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | diff of branch uncommitted changes | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getBranch** -> Ref getBranch(repository, branch) +> Ref getBranch(repository, branch).execute(); get branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -432,10 +440,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -448,11 +452,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | try { - Ref result = apiInstance.getBranch(repository, branch); + Ref result = apiInstance.getBranch(repository, branch) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#getBranch"); @@ -467,10 +476,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | ### Return type @@ -478,7 +487,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -488,31 +497,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | branch | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | branch | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listBranches** -> RefList listBranches(repository, prefix, after, amount) +> RefList listBranches(repository).prefix(prefix).after(after).amount(amount).execute(); list branches ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -525,10 +534,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -541,13 +546,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - RefList result = apiInstance.listBranches(repository, prefix, after, amount); + RefList result = apiInstance.listBranches(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#listBranches"); @@ -562,12 +575,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -575,7 +588,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -585,31 +598,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | branch list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | branch list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **resetBranch** -> resetBranch(repository, branch, resetCreation) +> resetBranch(repository, branch, resetCreation).execute(); reset branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -622,10 +635,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -638,12 +647,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | ResetCreation resetCreation = new ResetCreation(); // ResetCreation | try { - apiInstance.resetBranch(repository, branch, resetCreation); + apiInstance.resetBranch(repository, branch, resetCreation) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#resetBranch"); System.err.println("Status code: " + e.getCode()); @@ -657,11 +671,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **resetCreation** | [**ResetCreation**](ResetCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **resetCreation** | [**ResetCreation**](ResetCreation.md)| | | ### Return type @@ -669,7 +683,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -679,31 +693,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | reset successful | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | reset successful | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **revertBranch** -> revertBranch(repository, branch, revertCreation) +> revertBranch(repository, branch, revertCreation).execute(); revert ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.BranchesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -716,10 +730,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -732,12 +742,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | RevertCreation revertCreation = new RevertCreation(); // RevertCreation | try { - apiInstance.revertBranch(repository, branch, revertCreation); + apiInstance.revertBranch(repository, branch, revertCreation) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling BranchesApi#revertBranch"); System.err.println("Status code: " + e.getCode()); @@ -751,11 +766,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **revertCreation** | [**RevertCreation**](RevertCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **revertCreation** | [**RevertCreation**](RevertCreation.md)| | | ### Return type @@ -763,7 +778,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -773,10 +788,10 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | revert successful | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Conflict Found | - | -**0** | Internal Server Error | - | +| **204** | revert successful | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Conflict Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/CherryPickCreation.md b/clients/java/docs/CherryPickCreation.md index 5792d3befed..9f1300b6bbf 100644 --- a/clients/java/docs/CherryPickCreation.md +++ b/clients/java/docs/CherryPickCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ref** | **String** | the commit to cherry-pick, given by a ref | -**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. The destination branch is parent 1, which is the default behaviour. | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ref** | **String** | the commit to cherry-pick, given by a ref | | +|**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. The destination branch is parent 1, which is the default behaviour. | [optional] | diff --git a/clients/java/docs/CommPrefsInput.md b/clients/java/docs/CommPrefsInput.md index 1802f87fcde..db9e6b52bdb 100644 --- a/clients/java/docs/CommPrefsInput.md +++ b/clients/java/docs/CommPrefsInput.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | the provided email | [optional] -**featureUpdates** | **Boolean** | was \"feature updates\" checked | -**securityUpdates** | **Boolean** | was \"security updates\" checked | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | the provided email | [optional] | +|**featureUpdates** | **Boolean** | was \"feature updates\" checked | | +|**securityUpdates** | **Boolean** | was \"security updates\" checked | | diff --git a/clients/java/docs/Commit.md b/clients/java/docs/Commit.md index 02ac970bd9c..79f0768a3ae 100644 --- a/clients/java/docs/Commit.md +++ b/clients/java/docs/Commit.md @@ -5,15 +5,15 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**parents** | **List<String>** | | -**committer** | **String** | | -**message** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | -**metaRangeId** | **String** | | -**metadata** | **Map<String, String>** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**parents** | **List<String>** | | | +|**committer** | **String** | | | +|**message** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | | +|**metaRangeId** | **String** | | | +|**metadata** | **Map<String, String>** | | [optional] | diff --git a/clients/java/docs/CommitCreation.md b/clients/java/docs/CommitCreation.md index 3556070dbd8..f55b6812a43 100644 --- a/clients/java/docs/CommitCreation.md +++ b/clients/java/docs/CommitCreation.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **String** | | -**metadata** | **Map<String, String>** | | [optional] -**date** | **Long** | set date to override creation date in the commit (Unix Epoch in seconds) | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | | | +|**metadata** | **Map<String, String>** | | [optional] | +|**date** | **Long** | set date to override creation date in the commit (Unix Epoch in seconds) | [optional] | diff --git a/clients/java/docs/CommitList.md b/clients/java/docs/CommitList.md index 746bdbad057..ba8ebff8842 100644 --- a/clients/java/docs/CommitList.md +++ b/clients/java/docs/CommitList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Commit>**](Commit.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Commit>**](Commit.md) | | | diff --git a/clients/java/docs/CommitsApi.md b/clients/java/docs/CommitsApi.md index ad4a0f3881a..44d7b9896bf 100644 --- a/clients/java/docs/CommitsApi.md +++ b/clients/java/docs/CommitsApi.md @@ -1,33 +1,33 @@ # CommitsApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**commit**](CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit -[**getCommit**](CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**commit**](CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit | +| [**getCommit**](CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit | - + # **commit** -> Commit commit(repository, branch, commitCreation, sourceMetarange) +> Commit commit(repository, branch, commitCreation).sourceMetarange(sourceMetarange).execute(); create commit ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.CommitsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.CommitsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -40,10 +40,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -56,13 +52,19 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + CommitsApi apiInstance = new CommitsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | CommitCreation commitCreation = new CommitCreation(); // CommitCreation | String sourceMetarange = "sourceMetarange_example"; // String | The source metarange to commit. Branch must not have uncommitted changes. try { - Commit result = apiInstance.commit(repository, branch, commitCreation, sourceMetarange); + Commit result = apiInstance.commit(repository, branch, commitCreation) + .sourceMetarange(sourceMetarange) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CommitsApi#commit"); @@ -77,12 +79,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **commitCreation** | [**CommitCreation**](CommitCreation.md)| | - **sourceMetarange** | **String**| The source metarange to commit. Branch must not have uncommitted changes. | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **commitCreation** | [**CommitCreation**](CommitCreation.md)| | | +| **sourceMetarange** | **String**| The source metarange to commit. Branch must not have uncommitted changes. | [optional] | ### Return type @@ -90,7 +92,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -100,34 +102,34 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | commit | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**412** | Precondition Failed (e.g. a pre-commit hook returned a failure) | - | -**0** | Internal Server Error | - | - - +| **201** | commit | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **412** | Precondition Failed (e.g. a pre-commit hook returned a failure) | - | +| **0** | Internal Server Error | - | + + # **getCommit** -> Commit getCommit(repository, commitId) +> Commit getCommit(repository, commitId).execute(); get commit ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.CommitsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.CommitsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -140,10 +142,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -156,11 +154,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + CommitsApi apiInstance = new CommitsApi(defaultClient); String repository = "repository_example"; // String | String commitId = "commitId_example"; // String | try { - Commit result = apiInstance.getCommit(repository, commitId); + Commit result = apiInstance.getCommit(repository, commitId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CommitsApi#getCommit"); @@ -175,10 +178,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **commitId** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **commitId** | **String**| | | ### Return type @@ -186,7 +189,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -196,8 +199,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | commit | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | commit | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/ConfigApi.md b/clients/java/docs/ConfigApi.md index db0d43749a8..deaa5d5b9d9 100644 --- a/clients/java/docs/ConfigApi.md +++ b/clients/java/docs/ConfigApi.md @@ -1,17 +1,17 @@ # ConfigApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getGarbageCollectionConfig**](ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | -[**getLakeFSVersion**](ConfigApi.md#getLakeFSVersion) | **GET** /config/version | -[**getStorageConfig**](ConfigApi.md#getStorageConfig) | **GET** /config/storage | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getGarbageCollectionConfig**](ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | | +| [**getLakeFSVersion**](ConfigApi.md#getLakeFSVersion) | **GET** /config/version | | +| [**getStorageConfig**](ConfigApi.md#getStorageConfig) | **GET** /config/storage | | - + # **getGarbageCollectionConfig** -> GarbageCollectionConfig getGarbageCollectionConfig() +> GarbageCollectionConfig getGarbageCollectionConfig().execute(); @@ -20,17 +20,17 @@ get information of gc settings ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ConfigApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ConfigApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -43,10 +43,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -59,9 +55,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ConfigApi apiInstance = new ConfigApi(defaultClient); try { - GarbageCollectionConfig result = apiInstance.getGarbageCollectionConfig(); + GarbageCollectionConfig result = apiInstance.getGarbageCollectionConfig() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConfigApi#getGarbageCollectionConfig"); @@ -83,7 +84,7 @@ This endpoint does not need any parameter. ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -93,12 +94,12 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | lakeFS garbage collection config | - | -**401** | Unauthorized | - | +| **200** | lakeFS garbage collection config | - | +| **401** | Unauthorized | - | - + # **getLakeFSVersion** -> VersionConfig getLakeFSVersion() +> VersionConfig getLakeFSVersion().execute(); @@ -107,17 +108,17 @@ get version of lakeFS server ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ConfigApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ConfigApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -130,10 +131,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -146,9 +143,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ConfigApi apiInstance = new ConfigApi(defaultClient); try { - VersionConfig result = apiInstance.getLakeFSVersion(); + VersionConfig result = apiInstance.getLakeFSVersion() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConfigApi#getLakeFSVersion"); @@ -170,7 +172,7 @@ This endpoint does not need any parameter. ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -180,12 +182,12 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | lakeFS version | - | -**401** | Unauthorized | - | +| **200** | lakeFS version | - | +| **401** | Unauthorized | - | - + # **getStorageConfig** -> StorageConfig getStorageConfig() +> StorageConfig getStorageConfig().execute(); @@ -194,17 +196,17 @@ retrieve lakeFS storage configuration ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ConfigApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ConfigApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -217,10 +219,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -233,9 +231,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ConfigApi apiInstance = new ConfigApi(defaultClient); try { - StorageConfig result = apiInstance.getStorageConfig(); + StorageConfig result = apiInstance.getStorageConfig() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConfigApi#getStorageConfig"); @@ -257,7 +260,7 @@ This endpoint does not need any parameter. ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -267,6 +270,6 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | lakeFS storage configuration | - | -**401** | Unauthorized | - | +| **200** | lakeFS storage configuration | - | +| **401** | Unauthorized | - | diff --git a/clients/java/docs/Credentials.md b/clients/java/docs/Credentials.md index fe7e7c7cfbd..b70bdcb0f94 100644 --- a/clients/java/docs/Credentials.md +++ b/clients/java/docs/Credentials.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessKeyId** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | | diff --git a/clients/java/docs/CredentialsList.md b/clients/java/docs/CredentialsList.md index cf87d215c42..0b15a1e05c7 100644 --- a/clients/java/docs/CredentialsList.md +++ b/clients/java/docs/CredentialsList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Credentials>**](Credentials.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Credentials>**](Credentials.md) | | | diff --git a/clients/java/docs/CredentialsWithSecret.md b/clients/java/docs/CredentialsWithSecret.md index 82e9b89c207..c1267688eee 100644 --- a/clients/java/docs/CredentialsWithSecret.md +++ b/clients/java/docs/CredentialsWithSecret.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessKeyId** | **String** | | -**secretAccessKey** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | | | +|**secretAccessKey** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | | diff --git a/clients/java/docs/CurrentUser.md b/clients/java/docs/CurrentUser.md index 0c0af81ddfe..e4acbdd3209 100644 --- a/clients/java/docs/CurrentUser.md +++ b/clients/java/docs/CurrentUser.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user** | [**User**](User.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**user** | [**User**](User.md) | | | diff --git a/clients/java/docs/DeleteBranchProtectionRuleRequest.md b/clients/java/docs/DeleteBranchProtectionRuleRequest.md new file mode 100644 index 00000000000..66309d43385 --- /dev/null +++ b/clients/java/docs/DeleteBranchProtectionRuleRequest.md @@ -0,0 +1,13 @@ + + +# DeleteBranchProtectionRuleRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pattern** | **String** | | | + + + diff --git a/clients/java/docs/Diff.md b/clients/java/docs/Diff.md index 640d51ba54f..7307d49bd3b 100644 --- a/clients/java/docs/Diff.md +++ b/clients/java/docs/Diff.md @@ -5,33 +5,33 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**TypeEnum**](#TypeEnum) | | -**path** | **String** | | -**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | -**sizeBytes** | **Long** | represents the size of the added/changed/deleted entry | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**path** | **String** | | | +|**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | | +|**sizeBytes** | **Long** | represents the size of the added/changed/deleted entry | [optional] | ## Enum: TypeEnum -Name | Value ----- | ----- -ADDED | "added" -REMOVED | "removed" -CHANGED | "changed" -CONFLICT | "conflict" -PREFIX_CHANGED | "prefix_changed" +| Name | Value | +|---- | -----| +| ADDED | "added" | +| REMOVED | "removed" | +| CHANGED | "changed" | +| CONFLICT | "conflict" | +| PREFIX_CHANGED | "prefix_changed" | ## Enum: PathTypeEnum -Name | Value ----- | ----- -COMMON_PREFIX | "common_prefix" -OBJECT | "object" +| Name | Value | +|---- | -----| +| COMMON_PREFIX | "common_prefix" | +| OBJECT | "object" | diff --git a/clients/java/docs/DiffList.md b/clients/java/docs/DiffList.md index 17f99dedfa2..ca2790cb316 100644 --- a/clients/java/docs/DiffList.md +++ b/clients/java/docs/DiffList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Diff>**](Diff.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Diff>**](Diff.md) | | | diff --git a/clients/java/docs/DiffProperties.md b/clients/java/docs/DiffProperties.md index 839ef16e6d4..78005ee3e8f 100644 --- a/clients/java/docs/DiffProperties.md +++ b/clients/java/docs/DiffProperties.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | diff --git a/clients/java/docs/Error.md b/clients/java/docs/Error.md index 996ecb91cbc..19e017d4da1 100644 --- a/clients/java/docs/Error.md +++ b/clients/java/docs/Error.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **String** | short message explaining the error | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | short message explaining the error | | diff --git a/clients/java/docs/ErrorNoACL.md b/clients/java/docs/ErrorNoACL.md index cc0d72f6f35..fce4f1c66b6 100644 --- a/clients/java/docs/ErrorNoACL.md +++ b/clients/java/docs/ErrorNoACL.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **String** | short message explaining the error | -**noAcl** | **Boolean** | true if the group exists but has no ACL | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | short message explaining the error | | +|**noAcl** | **Boolean** | true if the group exists but has no ACL | [optional] | diff --git a/clients/java/docs/ExperimentalApi.md b/clients/java/docs/ExperimentalApi.md index 4e8e88fac2c..75f73518b34 100644 --- a/clients/java/docs/ExperimentalApi.md +++ b/clients/java/docs/ExperimentalApi.md @@ -1,33 +1,33 @@ # ExperimentalApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getOtfDiffs**](ExperimentalApi.md#getOtfDiffs) | **GET** /otf/diffs | get the available Open Table Format diffs -[**otfDiff**](ExperimentalApi.md#otfDiff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getOtfDiffs**](ExperimentalApi.md#getOtfDiffs) | **GET** /otf/diffs | get the available Open Table Format diffs | +| [**otfDiff**](ExperimentalApi.md#otfDiff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff | - + # **getOtfDiffs** -> OTFDiffs getOtfDiffs() +> OTFDiffs getOtfDiffs().execute(); get the available Open Table Format diffs ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ExperimentalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ExperimentalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -40,10 +40,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -56,9 +52,14 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ExperimentalApi apiInstance = new ExperimentalApi(defaultClient); try { - OTFDiffs result = apiInstance.getOtfDiffs(); + OTFDiffs result = apiInstance.getOtfDiffs() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExperimentalApi#getOtfDiffs"); @@ -80,7 +81,7 @@ This endpoint does not need any parameter. ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -90,30 +91,30 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | available Open Table Format diffs | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | available Open Table Format diffs | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **otfDiff** -> OtfDiffList otfDiff(repository, leftRef, rightRef, tablePath, type) +> OtfDiffList otfDiff(repository, leftRef, rightRef, tablePath, type).execute(); perform otf diff ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ExperimentalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ExperimentalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -126,10 +127,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -142,6 +139,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ExperimentalApi apiInstance = new ExperimentalApi(defaultClient); String repository = "repository_example"; // String | String leftRef = "leftRef_example"; // String | @@ -149,7 +150,8 @@ public class Example { String tablePath = "tablePath_example"; // String | a path to the table location under the specified ref. String type = "type_example"; // String | the type of otf try { - OtfDiffList result = apiInstance.otfDiff(repository, leftRef, rightRef, tablePath, type); + OtfDiffList result = apiInstance.otfDiff(repository, leftRef, rightRef, tablePath, type) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExperimentalApi#otfDiff"); @@ -164,13 +166,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **leftRef** | **String**| | - **rightRef** | **String**| | - **tablePath** | **String**| a path to the table location under the specified ref. | - **type** | **String**| the type of otf | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **leftRef** | **String**| | | +| **rightRef** | **String**| | | +| **tablePath** | **String**| a path to the table location under the specified ref. | | +| **type** | **String**| the type of otf | | ### Return type @@ -178,7 +180,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -188,9 +190,9 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | diff list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**412** | Precondition Failed | - | -**0** | Internal Server Error | - | +| **200** | diff list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **412** | Precondition Failed | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/FindMergeBaseResult.md b/clients/java/docs/FindMergeBaseResult.md index 227aeb19c3b..b265d13f6f9 100644 --- a/clients/java/docs/FindMergeBaseResult.md +++ b/clients/java/docs/FindMergeBaseResult.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceCommitId** | **String** | The commit ID of the merge source | -**destinationCommitId** | **String** | The commit ID of the merge destination | -**baseCommitId** | **String** | The commit ID of the merge base | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceCommitId** | **String** | The commit ID of the merge source | | +|**destinationCommitId** | **String** | The commit ID of the merge destination | | +|**baseCommitId** | **String** | The commit ID of the merge base | | diff --git a/clients/java/docs/GarbageCollectionConfig.md b/clients/java/docs/GarbageCollectionConfig.md index bca9ecf343c..478c69aef74 100644 --- a/clients/java/docs/GarbageCollectionConfig.md +++ b/clients/java/docs/GarbageCollectionConfig.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**gracePeriod** | **Integer** | Duration in seconds. Objects created in the recent grace_period will not be collected. | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**gracePeriod** | **Integer** | Duration in seconds. Objects created in the recent grace_period will not be collected. | [optional] | diff --git a/clients/java/docs/GarbageCollectionPrepareResponse.md b/clients/java/docs/GarbageCollectionPrepareResponse.md index 55e53a80dad..f59284084bd 100644 --- a/clients/java/docs/GarbageCollectionPrepareResponse.md +++ b/clients/java/docs/GarbageCollectionPrepareResponse.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runId** | **String** | a unique identifier generated for this GC job | -**gcCommitsLocation** | **String** | location of the resulting commits csv table (partitioned by run_id) | -**gcAddressesLocation** | **String** | location to use for expired addresses parquet table (partitioned by run_id) | -**gcCommitsPresignedUrl** | **String** | a presigned url to download the commits csv | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**runId** | **String** | a unique identifier generated for this GC job | | +|**gcCommitsLocation** | **String** | location of the resulting commits csv table (partitioned by run_id) | | +|**gcAddressesLocation** | **String** | location to use for expired addresses parquet table (partitioned by run_id) | | +|**gcCommitsPresignedUrl** | **String** | a presigned url to download the commits csv | [optional] | diff --git a/clients/java/docs/GarbageCollectionRule.md b/clients/java/docs/GarbageCollectionRule.md index 8d71ee5936b..537149933be 100644 --- a/clients/java/docs/GarbageCollectionRule.md +++ b/clients/java/docs/GarbageCollectionRule.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branchId** | **String** | | -**retentionDays** | **Integer** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**branchId** | **String** | | | +|**retentionDays** | **Integer** | | | diff --git a/clients/java/docs/GarbageCollectionRules.md b/clients/java/docs/GarbageCollectionRules.md index 47241dd588f..8f2ae001f53 100644 --- a/clients/java/docs/GarbageCollectionRules.md +++ b/clients/java/docs/GarbageCollectionRules.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**defaultRetentionDays** | **Integer** | | -**branches** | [**List<GarbageCollectionRule>**](GarbageCollectionRule.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**defaultRetentionDays** | **Integer** | | | +|**branches** | [**List<GarbageCollectionRule>**](GarbageCollectionRule.md) | | | diff --git a/clients/java/docs/Group.md b/clients/java/docs/Group.md index c3c0f61f329..82d59ba511c 100644 --- a/clients/java/docs/Group.md +++ b/clients/java/docs/Group.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | | diff --git a/clients/java/docs/GroupCreation.md b/clients/java/docs/GroupCreation.md index aa708281470..99f30ee35b4 100644 --- a/clients/java/docs/GroupCreation.md +++ b/clients/java/docs/GroupCreation.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | diff --git a/clients/java/docs/GroupList.md b/clients/java/docs/GroupList.md index ec0135a5d27..e476e24854d 100644 --- a/clients/java/docs/GroupList.md +++ b/clients/java/docs/GroupList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Group>**](Group.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Group>**](Group.md) | | | diff --git a/clients/java/docs/HealthCheckApi.md b/clients/java/docs/HealthCheckApi.md index a2fb177f41f..b6ab49456c1 100644 --- a/clients/java/docs/HealthCheckApi.md +++ b/clients/java/docs/HealthCheckApi.md @@ -1,15 +1,15 @@ # HealthCheckApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**healthCheck**](HealthCheckApi.md#healthCheck) | **GET** /healthcheck | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**healthCheck**](HealthCheckApi.md#healthCheck) | **GET** /healthcheck | | - + # **healthCheck** -> healthCheck() +> healthCheck().execute(); @@ -18,20 +18,21 @@ check that the API server is up and running ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.HealthCheckApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.HealthCheckApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); HealthCheckApi apiInstance = new HealthCheckApi(defaultClient); try { - apiInstance.healthCheck(); + apiInstance.healthCheck() + .execute(); } catch (ApiException e) { System.err.println("Exception when calling HealthCheckApi#healthCheck"); System.err.println("Status code: " + e.getCode()); @@ -62,5 +63,5 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | NoContent | - | +| **204** | NoContent | - | diff --git a/clients/java/docs/HookRun.md b/clients/java/docs/HookRun.md index 9f046a5a807..eb9fa727b7d 100644 --- a/clients/java/docs/HookRun.md +++ b/clients/java/docs/HookRun.md @@ -5,23 +5,23 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hookRunId** | **String** | | -**action** | **String** | | -**hookId** | **String** | | -**startTime** | **OffsetDateTime** | | -**endTime** | **OffsetDateTime** | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hookRunId** | **String** | | | +|**action** | **String** | | | +|**hookId** | **String** | | | +|**startTime** | **OffsetDateTime** | | | +|**endTime** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | | | ## Enum: StatusEnum -Name | Value ----- | ----- -FAILED | "failed" -COMPLETED | "completed" +| Name | Value | +|---- | -----| +| FAILED | "failed" | +| COMPLETED | "completed" | diff --git a/clients/java/docs/HookRunList.md b/clients/java/docs/HookRunList.md index ee78cfec604..26d17c92323 100644 --- a/clients/java/docs/HookRunList.md +++ b/clients/java/docs/HookRunList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<HookRun>**](HookRun.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<HookRun>**](HookRun.md) | | | diff --git a/clients/java/docs/ImportApi.md b/clients/java/docs/ImportApi.md index 1746e39662f..a1efa0d393c 100644 --- a/clients/java/docs/ImportApi.md +++ b/clients/java/docs/ImportApi.md @@ -1,34 +1,34 @@ # ImportApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**importCancel**](ImportApi.md#importCancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import -[**importStart**](ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store -[**importStatus**](ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**importCancel**](ImportApi.md#importCancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import | +| [**importStart**](ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store | +| [**importStatus**](ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status | - + # **importCancel** -> importCancel(repository, branch, id) +> importCancel(repository, branch, id).execute(); cancel ongoing import ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ImportApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ImportApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -41,10 +41,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -57,12 +53,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ImportApi apiInstance = new ImportApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String id = "id_example"; // String | Unique identifier of the import process try { - apiInstance.importCancel(repository, branch, id); + apiInstance.importCancel(repository, branch, id) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling ImportApi#importCancel"); System.err.println("Status code: " + e.getCode()); @@ -76,11 +77,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **id** | **String**| Unique identifier of the import process | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **id** | **String**| Unique identifier of the import process | | ### Return type @@ -88,7 +89,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -98,33 +99,33 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | import canceled successfully | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | - - +| **204** | import canceled successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | + + # **importStart** -> ImportCreationResponse importStart(repository, branch, importCreation) +> ImportCreationResponse importStart(repository, branch, importCreation).execute(); import data from object store ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ImportApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ImportApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -137,10 +138,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -153,12 +150,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ImportApi apiInstance = new ImportApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | ImportCreation importCreation = new ImportCreation(); // ImportCreation | try { - ImportCreationResponse result = apiInstance.importStart(repository, branch, importCreation); + ImportCreationResponse result = apiInstance.importStart(repository, branch, importCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ImportApi#importStart"); @@ -173,11 +175,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **importCreation** | [**ImportCreation**](ImportCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **importCreation** | [**ImportCreation**](ImportCreation.md)| | | ### Return type @@ -185,7 +187,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -195,32 +197,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**202** | Import started | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **202** | Import started | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **importStatus** -> ImportStatus importStatus(repository, branch, id) +> ImportStatus importStatus(repository, branch, id).execute(); get import status ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ImportApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ImportApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -233,10 +235,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -249,12 +247,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ImportApi apiInstance = new ImportApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String id = "id_example"; // String | Unique identifier of the import process try { - ImportStatus result = apiInstance.importStatus(repository, branch, id); + ImportStatus result = apiInstance.importStatus(repository, branch, id) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ImportApi#importStatus"); @@ -269,11 +272,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **id** | **String**| Unique identifier of the import process | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **id** | **String**| Unique identifier of the import process | | ### Return type @@ -281,7 +284,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -291,8 +294,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | import status | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | import status | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/ImportCreation.md b/clients/java/docs/ImportCreation.md index fe61b88b638..c7a89e80883 100644 --- a/clients/java/docs/ImportCreation.md +++ b/clients/java/docs/ImportCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**paths** | [**List<ImportLocation>**](ImportLocation.md) | | -**commit** | [**CommitCreation**](CommitCreation.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paths** | [**List<ImportLocation>**](ImportLocation.md) | | | +|**commit** | [**CommitCreation**](CommitCreation.md) | | | diff --git a/clients/java/docs/ImportCreationResponse.md b/clients/java/docs/ImportCreationResponse.md index 98b8852d49f..6113e5526fd 100644 --- a/clients/java/docs/ImportCreationResponse.md +++ b/clients/java/docs/ImportCreationResponse.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | The id of the import process | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The id of the import process | | diff --git a/clients/java/docs/ImportLocation.md b/clients/java/docs/ImportLocation.md index bbea056cd4e..7f7200dd731 100644 --- a/clients/java/docs/ImportLocation.md +++ b/clients/java/docs/ImportLocation.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**TypeEnum**](#TypeEnum) | Path type, can either be 'common_prefix' or 'object' | -**path** | **String** | A source location to import path or to a single object. Must match the lakeFS installation blockstore type. | -**destination** | **String** | Destination for the imported objects on the branch | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | Path type, can either be 'common_prefix' or 'object' | | +|**path** | **String** | A source location to import path or to a single object. Must match the lakeFS installation blockstore type. | | +|**destination** | **String** | Destination for the imported objects on the branch | | ## Enum: TypeEnum -Name | Value ----- | ----- -COMMON_PREFIX | "common_prefix" -OBJECT | "object" +| Name | Value | +|---- | -----| +| COMMON_PREFIX | "common_prefix" | +| OBJECT | "object" | diff --git a/clients/java/docs/ImportStatus.md b/clients/java/docs/ImportStatus.md index e184f352672..64fdb3ff672 100644 --- a/clients/java/docs/ImportStatus.md +++ b/clients/java/docs/ImportStatus.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**completed** | **Boolean** | | -**updateTime** | **OffsetDateTime** | | -**ingestedObjects** | **Long** | Number of objects processed so far | [optional] -**metarangeId** | **String** | | [optional] -**commit** | [**Commit**](Commit.md) | | [optional] -**error** | [**Error**](Error.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**completed** | **Boolean** | | | +|**updateTime** | **OffsetDateTime** | | | +|**ingestedObjects** | **Long** | Number of objects processed so far | [optional] | +|**metarangeId** | **String** | | [optional] | +|**commit** | [**Commit**](Commit.md) | | [optional] | +|**error** | [**Error**](Error.md) | | [optional] | diff --git a/clients/java/docs/InternalApi.md b/clients/java/docs/InternalApi.md index 3e631593959..007d89026c4 100644 --- a/clients/java/docs/InternalApi.md +++ b/clients/java/docs/InternalApi.md @@ -1,40 +1,40 @@ # InternalApi -All URIs are relative to *http://localhost/api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createBranchProtectionRulePreflight**](InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | -[**createSymlinkFile**](InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory -[**getAuthCapabilities**](InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported -[**getSetupState**](InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up -[**postStatsEvents**](InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only -[**setGarbageCollectionRulesPreflight**](InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | -[**setup**](InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user -[**setupCommPrefs**](InternalApi.md#setupCommPrefs) | **POST** /setup_comm_prefs | setup communications preferences -[**uploadObjectPreflight**](InternalApi.md#uploadObjectPreflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | - - - +All URIs are relative to */api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createBranchProtectionRulePreflight**](InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | | +| [**createSymlinkFile**](InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory | +| [**getAuthCapabilities**](InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported | +| [**getSetupState**](InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up | +| [**postStatsEvents**](InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only | +| [**setGarbageCollectionRulesPreflight**](InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | | +| [**setup**](InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user | +| [**setupCommPrefs**](InternalApi.md#setupCommPrefs) | **POST** /setup_comm_prefs | setup communications preferences | +| [**uploadObjectPreflight**](InternalApi.md#uploadObjectPreflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | | + + + # **createBranchProtectionRulePreflight** -> createBranchProtectionRulePreflight(repository) +> createBranchProtectionRulePreflight(repository).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -47,10 +47,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -63,10 +59,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + InternalApi apiInstance = new InternalApi(defaultClient); String repository = "repository_example"; // String | try { - apiInstance.createBranchProtectionRulePreflight(repository); + apiInstance.createBranchProtectionRulePreflight(repository) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#createBranchProtectionRulePreflight"); System.err.println("Status code: " + e.getCode()); @@ -80,9 +81,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -90,7 +91,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -100,32 +101,32 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | User has permissions to create a branch protection rule in this repository | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | +| **204** | User has permissions to create a branch protection rule in this repository | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | - + # **createSymlinkFile** -> StorageURI createSymlinkFile(repository, branch, location) +> StorageURI createSymlinkFile(repository, branch).location(location).execute(); creates symlink files corresponding to the given directory ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -138,10 +139,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -154,12 +151,18 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + InternalApi apiInstance = new InternalApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String location = "location_example"; // String | path to the table data try { - StorageURI result = apiInstance.createSymlinkFile(repository, branch, location); + StorageURI result = apiInstance.createSymlinkFile(repository, branch) + .location(location) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#createSymlinkFile"); @@ -174,11 +177,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **location** | **String**| path to the table data | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **location** | **String**| path to the table data | [optional] | ### Return type @@ -186,7 +189,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -196,34 +199,35 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | location created | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | location created | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getAuthCapabilities** -> AuthCapabilities getAuthCapabilities() +> AuthCapabilities getAuthCapabilities().execute(); list authentication capabilities supported ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); InternalApi apiInstance = new InternalApi(defaultClient); try { - AuthCapabilities result = apiInstance.getAuthCapabilities(); + AuthCapabilities result = apiInstance.getAuthCapabilities() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#getAuthCapabilities"); @@ -255,32 +259,33 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | auth capabilities | - | -**0** | Internal Server Error | - | +| **200** | auth capabilities | - | +| **0** | Internal Server Error | - | - + # **getSetupState** -> SetupState getSetupState() +> SetupState getSetupState().execute(); check if the lakeFS installation is already set up ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); InternalApi apiInstance = new InternalApi(defaultClient); try { - SetupState result = apiInstance.getSetupState(); + SetupState result = apiInstance.getSetupState() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#getSetupState"); @@ -312,29 +317,29 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | lakeFS setup state | - | -**0** | Internal Server Error | - | +| **200** | lakeFS setup state | - | +| **0** | Internal Server Error | - | - + # **postStatsEvents** -> postStatsEvents(statsEventsList) +> postStatsEvents(statsEventsList).execute(); post stats events, this endpoint is meant for internal use only ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -347,10 +352,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -363,10 +364,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + InternalApi apiInstance = new InternalApi(defaultClient); StatsEventsList statsEventsList = new StatsEventsList(); // StatsEventsList | try { - apiInstance.postStatsEvents(statsEventsList); + apiInstance.postStatsEvents(statsEventsList) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#postStatsEvents"); System.err.println("Status code: " + e.getCode()); @@ -380,9 +386,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **statsEventsList** | [**StatsEventsList**](StatsEventsList.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **statsEventsList** | [**StatsEventsList**](StatsEventsList.md)| | | ### Return type @@ -390,7 +396,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -400,31 +406,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | reported successfully | - | -**400** | Bad Request | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **204** | reported successfully | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | - + # **setGarbageCollectionRulesPreflight** -> setGarbageCollectionRulesPreflight(repository) +> setGarbageCollectionRulesPreflight(repository).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -437,10 +443,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -453,10 +455,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + InternalApi apiInstance = new InternalApi(defaultClient); String repository = "repository_example"; // String | try { - apiInstance.setGarbageCollectionRulesPreflight(repository); + apiInstance.setGarbageCollectionRulesPreflight(repository) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#setGarbageCollectionRulesPreflight"); System.err.println("Status code: " + e.getCode()); @@ -470,9 +477,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -480,7 +487,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -490,35 +497,36 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | User has permissions to set garbage collection rules on this repository | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | User has permissions to set garbage collection rules on this repository | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **setup** -> CredentialsWithSecret setup(setup) +> CredentialsWithSecret setup(setup).execute(); setup lakeFS and create a first user ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); InternalApi apiInstance = new InternalApi(defaultClient); Setup setup = new Setup(); // Setup | try { - CredentialsWithSecret result = apiInstance.setup(setup); + CredentialsWithSecret result = apiInstance.setup(setup) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#setup"); @@ -533,9 +541,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **setup** | [**Setup**](Setup.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **setup** | [**Setup**](Setup.md)| | | ### Return type @@ -553,35 +561,36 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | user created successfully | - | -**400** | Bad Request | - | -**409** | setup was already called | - | -**0** | Internal Server Error | - | +| **200** | user created successfully | - | +| **400** | Bad Request | - | +| **409** | setup was already called | - | +| **0** | Internal Server Error | - | - + # **setupCommPrefs** -> setupCommPrefs(commPrefsInput) +> setupCommPrefs(commPrefsInput).execute(); setup communications preferences ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); InternalApi apiInstance = new InternalApi(defaultClient); CommPrefsInput commPrefsInput = new CommPrefsInput(); // CommPrefsInput | try { - apiInstance.setupCommPrefs(commPrefsInput); + apiInstance.setupCommPrefs(commPrefsInput) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#setupCommPrefs"); System.err.println("Status code: " + e.getCode()); @@ -595,9 +604,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commPrefsInput** | [**CommPrefsInput**](CommPrefsInput.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **commPrefsInput** | [**CommPrefsInput**](CommPrefsInput.md)| | | ### Return type @@ -615,31 +624,31 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | communication preferences saved successfully | - | -**409** | setup was already completed | - | -**412** | wrong setup state for this operation | - | -**0** | Internal Server Error | - | +| **200** | communication preferences saved successfully | - | +| **409** | setup was already completed | - | +| **412** | wrong setup state for this operation | - | +| **0** | Internal Server Error | - | - + # **uploadObjectPreflight** -> uploadObjectPreflight(repository, branch, path) +> uploadObjectPreflight(repository, branch, path).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.InternalApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.InternalApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -652,10 +661,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -668,12 +673,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + InternalApi apiInstance = new InternalApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String path = "path_example"; // String | relative to the branch try { - apiInstance.uploadObjectPreflight(repository, branch, path); + apiInstance.uploadObjectPreflight(repository, branch, path) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling InternalApi#uploadObjectPreflight"); System.err.println("Status code: " + e.getCode()); @@ -687,11 +697,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | ### Return type @@ -699,7 +709,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -709,9 +719,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/LoginConfig.md b/clients/java/docs/LoginConfig.md index ee91a722819..6a9da45cdad 100644 --- a/clients/java/docs/LoginConfig.md +++ b/clients/java/docs/LoginConfig.md @@ -5,24 +5,24 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RBAC** | [**RBACEnum**](#RBACEnum) | RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. | [optional] -**loginUrl** | **String** | primary URL to use for login. | -**loginFailedMessage** | **String** | message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method | [optional] -**fallbackLoginUrl** | **String** | secondary URL to offer users to use for login. | [optional] -**fallbackLoginLabel** | **String** | label to place on fallback_login_url. | [optional] -**loginCookieNames** | **List<String>** | cookie names used to store JWT | -**logoutUrl** | **String** | URL to use for logging out. | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**RBAC** | [**RBACEnum**](#RBACEnum) | RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. | [optional] | +|**loginUrl** | **String** | primary URL to use for login. | | +|**loginFailedMessage** | **String** | message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method | [optional] | +|**fallbackLoginUrl** | **String** | secondary URL to offer users to use for login. | [optional] | +|**fallbackLoginLabel** | **String** | label to place on fallback_login_url. | [optional] | +|**loginCookieNames** | **List<String>** | cookie names used to store JWT | | +|**logoutUrl** | **String** | URL to use for logging out. | | ## Enum: RBACEnum -Name | Value ----- | ----- -SIMPLIFIED | "simplified" -EXTERNAL | "external" +| Name | Value | +|---- | -----| +| SIMPLIFIED | "simplified" | +| EXTERNAL | "external" | diff --git a/clients/java/docs/LoginInformation.md b/clients/java/docs/LoginInformation.md index 2e7005e504a..c99261b2ec6 100644 --- a/clients/java/docs/LoginInformation.md +++ b/clients/java/docs/LoginInformation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessKeyId** | **String** | | -**secretAccessKey** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | | | +|**secretAccessKey** | **String** | | | diff --git a/clients/java/docs/Merge.md b/clients/java/docs/Merge.md index 7d295da0bbd..e10a6da187b 100644 --- a/clients/java/docs/Merge.md +++ b/clients/java/docs/Merge.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **String** | | [optional] -**metadata** | **Map<String, String>** | | [optional] -**strategy** | **String** | In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | | [optional] | +|**metadata** | **Map<String, String>** | | [optional] | +|**strategy** | **String** | In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict | [optional] | diff --git a/clients/java/docs/MergeResult.md b/clients/java/docs/MergeResult.md index ade30e913af..3203d79c2c9 100644 --- a/clients/java/docs/MergeResult.md +++ b/clients/java/docs/MergeResult.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reference** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reference** | **String** | | | diff --git a/clients/java/docs/MetaRangeCreation.md b/clients/java/docs/MetaRangeCreation.md index c80331077ac..487594447f3 100644 --- a/clients/java/docs/MetaRangeCreation.md +++ b/clients/java/docs/MetaRangeCreation.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ranges** | [**List<RangeMetadata>**](RangeMetadata.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ranges** | [**List<RangeMetadata>**](RangeMetadata.md) | | | diff --git a/clients/java/docs/MetaRangeCreationResponse.md b/clients/java/docs/MetaRangeCreationResponse.md index 7480032cb74..ea264f87c47 100644 --- a/clients/java/docs/MetaRangeCreationResponse.md +++ b/clients/java/docs/MetaRangeCreationResponse.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | The id of the created metarange | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The id of the created metarange | [optional] | diff --git a/clients/java/docs/MetadataApi.md b/clients/java/docs/MetadataApi.md index f4d70ba1d10..8458c9541a5 100644 --- a/clients/java/docs/MetadataApi.md +++ b/clients/java/docs/MetadataApi.md @@ -1,33 +1,33 @@ # MetadataApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getMetaRange**](MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file -[**getRange**](MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getMetaRange**](MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file | +| [**getRange**](MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file | - + # **getMetaRange** -> StorageURI getMetaRange(repository, metaRange) +> StorageURI getMetaRange(repository, metaRange).execute(); return URI to a meta-range file ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.MetadataApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.MetadataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -40,10 +40,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -56,11 +52,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + MetadataApi apiInstance = new MetadataApi(defaultClient); String repository = "repository_example"; // String | String metaRange = "metaRange_example"; // String | try { - StorageURI result = apiInstance.getMetaRange(repository, metaRange); + StorageURI result = apiInstance.getMetaRange(repository, metaRange) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MetadataApi#getMetaRange"); @@ -75,10 +76,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **metaRange** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **metaRange** | **String**| | | ### Return type @@ -86,7 +87,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -96,31 +97,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | meta-range URI | * Location - redirect to S3
| -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | meta-range URI | * Location - redirect to S3
| +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getRange** -> StorageURI getRange(repository, range) +> StorageURI getRange(repository, range).execute(); return URI to a range file ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.MetadataApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.MetadataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -133,10 +134,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -149,11 +146,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + MetadataApi apiInstance = new MetadataApi(defaultClient); String repository = "repository_example"; // String | String range = "range_example"; // String | try { - StorageURI result = apiInstance.getRange(repository, range); + StorageURI result = apiInstance.getRange(repository, range) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MetadataApi#getRange"); @@ -168,10 +170,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **range** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **range** | **String**| | | ### Return type @@ -179,7 +181,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -189,8 +191,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | range URI | * Location - redirect to S3
| -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | range URI | * Location - redirect to S3
| +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/OTFDiffs.md b/clients/java/docs/OTFDiffs.md index decae899d7a..f76bc8d87e2 100644 --- a/clients/java/docs/OTFDiffs.md +++ b/clients/java/docs/OTFDiffs.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diffs** | [**List<DiffProperties>**](DiffProperties.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diffs** | [**List<DiffProperties>**](DiffProperties.md) | | [optional] | diff --git a/clients/java/docs/ObjectCopyCreation.md b/clients/java/docs/ObjectCopyCreation.md index ac3b35ed570..719665bd901 100644 --- a/clients/java/docs/ObjectCopyCreation.md +++ b/clients/java/docs/ObjectCopyCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**srcPath** | **String** | path of the copied object relative to the ref | -**srcRef** | **String** | a reference, if empty uses the provided branch as ref | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**srcPath** | **String** | path of the copied object relative to the ref | | +|**srcRef** | **String** | a reference, if empty uses the provided branch as ref | [optional] | diff --git a/clients/java/docs/ObjectError.md b/clients/java/docs/ObjectError.md index 9f31da2bc2d..e29a2ab78c8 100644 --- a/clients/java/docs/ObjectError.md +++ b/clients/java/docs/ObjectError.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**statusCode** | **Integer** | HTTP status code associated for operation on path | -**message** | **String** | short message explaining status_code | -**path** | **String** | affected path | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**statusCode** | **Integer** | HTTP status code associated for operation on path | | +|**message** | **String** | short message explaining status_code | | +|**path** | **String** | affected path | [optional] | diff --git a/clients/java/docs/ObjectErrorList.md b/clients/java/docs/ObjectErrorList.md index f94202ec3b5..d3b98778866 100644 --- a/clients/java/docs/ObjectErrorList.md +++ b/clients/java/docs/ObjectErrorList.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**errors** | [**List<ObjectError>**](ObjectError.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**errors** | [**List<ObjectError>**](ObjectError.md) | | | diff --git a/clients/java/docs/ObjectStageCreation.md b/clients/java/docs/ObjectStageCreation.md index 3a0e1cfd15d..b372d839452 100644 --- a/clients/java/docs/ObjectStageCreation.md +++ b/clients/java/docs/ObjectStageCreation.md @@ -5,14 +5,14 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**physicalAddress** | **String** | | -**checksum** | **String** | | -**sizeBytes** | **Long** | | -**mtime** | **Long** | Unix Epoch in seconds | [optional] -**metadata** | **Map<String, String>** | | [optional] -**contentType** | **String** | Object media type | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**physicalAddress** | **String** | | | +|**checksum** | **String** | | | +|**sizeBytes** | **Long** | | | +|**mtime** | **Long** | Unix Epoch in seconds | [optional] | +|**metadata** | **Map<String, String>** | | [optional] | +|**contentType** | **String** | Object media type | [optional] | diff --git a/clients/java/docs/ObjectStats.md b/clients/java/docs/ObjectStats.md index ed818768da7..94e2c738e6e 100644 --- a/clients/java/docs/ObjectStats.md +++ b/clients/java/docs/ObjectStats.md @@ -5,26 +5,26 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**path** | **String** | | -**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | -**physicalAddress** | **String** | The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET | -**physicalAddressExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] -**checksum** | **String** | | -**sizeBytes** | **Long** | | [optional] -**mtime** | **Long** | Unix Epoch in seconds | -**metadata** | **Map<String, String>** | | [optional] -**contentType** | **String** | Object media type | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**path** | **String** | | | +|**pathType** | [**PathTypeEnum**](#PathTypeEnum) | | | +|**physicalAddress** | **String** | The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET | | +|**physicalAddressExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] | +|**checksum** | **String** | | | +|**sizeBytes** | **Long** | | [optional] | +|**mtime** | **Long** | Unix Epoch in seconds | | +|**metadata** | **Map<String, String>** | | [optional] | +|**contentType** | **String** | Object media type | [optional] | ## Enum: PathTypeEnum -Name | Value ----- | ----- -COMMON_PREFIX | "common_prefix" -OBJECT | "object" +| Name | Value | +|---- | -----| +| COMMON_PREFIX | "common_prefix" | +| OBJECT | "object" | diff --git a/clients/java/docs/ObjectStatsList.md b/clients/java/docs/ObjectStatsList.md index 7db300499db..f5914baf1fc 100644 --- a/clients/java/docs/ObjectStatsList.md +++ b/clients/java/docs/ObjectStatsList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<ObjectStats>**](ObjectStats.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<ObjectStats>**](ObjectStats.md) | | | diff --git a/clients/java/docs/ObjectsApi.md b/clients/java/docs/ObjectsApi.md index a34aebab0d0..dac475b43b9 100644 --- a/clients/java/docs/ObjectsApi.md +++ b/clients/java/docs/ObjectsApi.md @@ -1,41 +1,41 @@ # ObjectsApi -All URIs are relative to *http://localhost/api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**copyObject**](ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object -[**deleteObject**](ObjectsApi.md#deleteObject) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. -[**deleteObjects**](ObjectsApi.md#deleteObjects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. -[**getObject**](ObjectsApi.md#getObject) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content -[**getUnderlyingProperties**](ObjectsApi.md#getUnderlyingProperties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage -[**headObject**](ObjectsApi.md#headObject) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists -[**listObjects**](ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix -[**stageObject**](ObjectsApi.md#stageObject) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch -[**statObject**](ObjectsApi.md#statObject) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata -[**uploadObject**](ObjectsApi.md#uploadObject) | **POST** /repositories/{repository}/branches/{branch}/objects | - - - +All URIs are relative to */api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**copyObject**](ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object | +| [**deleteObject**](ObjectsApi.md#deleteObject) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. | +| [**deleteObjects**](ObjectsApi.md#deleteObjects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. | +| [**getObject**](ObjectsApi.md#getObject) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content | +| [**getUnderlyingProperties**](ObjectsApi.md#getUnderlyingProperties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage | +| [**headObject**](ObjectsApi.md#headObject) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists | +| [**listObjects**](ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix | +| [**stageObject**](ObjectsApi.md#stageObject) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch | +| [**statObject**](ObjectsApi.md#statObject) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata | +| [**uploadObject**](ObjectsApi.md#uploadObject) | **POST** /repositories/{repository}/branches/{branch}/objects | | + + + # **copyObject** -> ObjectStats copyObject(repository, branch, destPath, objectCopyCreation) +> ObjectStats copyObject(repository, branch, destPath, objectCopyCreation).execute(); create a copy of an object ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -48,10 +48,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -64,13 +60,18 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | destination branch for the copy String destPath = "destPath_example"; // String | destination path relative to the branch ObjectCopyCreation objectCopyCreation = new ObjectCopyCreation(); // ObjectCopyCreation | try { - ObjectStats result = apiInstance.copyObject(repository, branch, destPath, objectCopyCreation); + ObjectStats result = apiInstance.copyObject(repository, branch, destPath, objectCopyCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#copyObject"); @@ -85,12 +86,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| destination branch for the copy | - **destPath** | **String**| destination path relative to the branch | - **objectCopyCreation** | [**ObjectCopyCreation**](ObjectCopyCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| destination branch for the copy | | +| **destPath** | **String**| destination path relative to the branch | | +| **objectCopyCreation** | [**ObjectCopyCreation**](ObjectCopyCreation.md)| | | ### Return type @@ -98,7 +99,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -108,32 +109,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Copy object response | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | Copy object response | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteObject** -> deleteObject(repository, branch, path) +> deleteObject(repository, branch, path).execute(); delete object. Missing objects will not return a NotFound error. ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -146,10 +147,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -162,12 +159,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String path = "path_example"; // String | relative to the branch try { - apiInstance.deleteObject(repository, branch, path); + apiInstance.deleteObject(repository, branch, path) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#deleteObject"); System.err.println("Status code: " + e.getCode()); @@ -181,11 +183,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | ### Return type @@ -193,7 +195,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -203,32 +205,32 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | object deleted successfully | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | object deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteObjects** -> ObjectErrorList deleteObjects(repository, branch, pathList) +> ObjectErrorList deleteObjects(repository, branch, pathList).execute(); delete objects. Missing objects will not return a NotFound error. ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -241,10 +243,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -257,12 +255,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | PathList pathList = new PathList(); // PathList | try { - ObjectErrorList result = apiInstance.deleteObjects(repository, branch, pathList); + ObjectErrorList result = apiInstance.deleteObjects(repository, branch, pathList) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#deleteObjects"); @@ -277,11 +280,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **pathList** | [**PathList**](PathList.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **pathList** | [**PathList**](PathList.md)| | | ### Return type @@ -289,7 +292,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -299,32 +302,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Delete objects response | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | Delete objects response | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getObject** -> File getObject(repository, ref, path, range, presign) +> File getObject(repository, ref, path).range(range).presign(presign).execute(); get object content ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -337,10 +340,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -353,6 +352,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) @@ -360,7 +363,10 @@ public class Example { String range = "bytes=0-1023"; // String | Byte range to retrieve Boolean presign = true; // Boolean | try { - File result = apiInstance.getObject(repository, ref, path, range, presign); + File result = apiInstance.getObject(repository, ref, path) + .range(range) + .presign(presign) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#getObject"); @@ -375,13 +381,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| a reference (could be either a branch or a commit ID) | - **path** | **String**| relative to the ref | - **range** | **String**| Byte range to retrieve | [optional] - **presign** | **Boolean**| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| a reference (could be either a branch or a commit ID) | | +| **path** | **String**| relative to the ref | | +| **range** | **String**| Byte range to retrieve | [optional] | +| **presign** | **Boolean**| | [optional] | ### Return type @@ -389,7 +395,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -399,35 +405,35 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object content | * Content-Length -
* Last-Modified -
* ETag -
| -**206** | partial object content | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| -**302** | Redirect to a pre-signed URL for the object | * Location - redirect to S3
| -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**410** | object expired | - | -**416** | Requested Range Not Satisfiable | - | -**0** | Internal Server Error | - | - - +| **200** | object content | * Content-Length -
* Last-Modified -
* ETag -
| +| **206** | partial object content | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| +| **302** | Redirect to a pre-signed URL for the object | * Location - redirect to S3
| +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **410** | object expired | - | +| **416** | Requested Range Not Satisfiable | - | +| **0** | Internal Server Error | - | + + # **getUnderlyingProperties** -> UnderlyingObjectProperties getUnderlyingProperties(repository, ref, path) +> UnderlyingObjectProperties getUnderlyingProperties(repository, ref, path).execute(); get object properties on underlying storage ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -440,10 +446,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -456,12 +458,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) String path = "path_example"; // String | relative to the branch try { - UnderlyingObjectProperties result = apiInstance.getUnderlyingProperties(repository, ref, path); + UnderlyingObjectProperties result = apiInstance.getUnderlyingProperties(repository, ref, path) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#getUnderlyingProperties"); @@ -476,11 +483,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| a reference (could be either a branch or a commit ID) | - **path** | **String**| relative to the branch | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| a reference (could be either a branch or a commit ID) | | +| **path** | **String**| relative to the branch | | ### Return type @@ -488,7 +495,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -498,31 +505,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object metadata on underlying storage | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | object metadata on underlying storage | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **headObject** -> headObject(repository, ref, path, range) +> headObject(repository, ref, path).range(range).execute(); check if object exists ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -535,10 +542,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -551,13 +554,19 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) String path = "path_example"; // String | relative to the ref String range = "bytes=0-1023"; // String | Byte range to retrieve try { - apiInstance.headObject(repository, ref, path, range); + apiInstance.headObject(repository, ref, path) + .range(range) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#headObject"); System.err.println("Status code: " + e.getCode()); @@ -571,12 +580,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| a reference (could be either a branch or a commit ID) | - **path** | **String**| relative to the ref | - **range** | **String**| Byte range to retrieve | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| a reference (could be either a branch or a commit ID) | | +| **path** | **String**| relative to the ref | | +| **range** | **String**| Byte range to retrieve | [optional] | ### Return type @@ -584,7 +593,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -594,34 +603,34 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object exists | * Content-Length -
* Last-Modified -
* ETag -
| -**206** | partial object content info | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| -**401** | Unauthorized | - | -**404** | object not found | - | -**410** | object expired | - | -**416** | Requested Range Not Satisfiable | - | -**0** | internal server error | - | - - +| **200** | object exists | * Content-Length -
* Last-Modified -
* ETag -
| +| **206** | partial object content info | * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
| +| **401** | Unauthorized | - | +| **404** | object not found | - | +| **410** | object expired | - | +| **416** | Requested Range Not Satisfiable | - | +| **0** | internal server error | - | + + # **listObjects** -> ObjectStatsList listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix) +> ObjectStatsList listObjects(repository, ref).userMetadata(userMetadata).presign(presign).after(after).amount(amount).delimiter(delimiter).prefix(prefix).execute(); list objects under a given prefix ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -634,10 +643,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -650,6 +655,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) @@ -660,7 +669,14 @@ public class Example { String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by String prefix = "prefix_example"; // String | return items prefixed with this value try { - ObjectStatsList result = apiInstance.listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix); + ObjectStatsList result = apiInstance.listObjects(repository, ref) + .userMetadata(userMetadata) + .presign(presign) + .after(after) + .amount(amount) + .delimiter(delimiter) + .prefix(prefix) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#listObjects"); @@ -675,16 +691,16 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| a reference (could be either a branch or a commit ID) | - **userMetadata** | **Boolean**| | [optional] [default to true] - **presign** | **Boolean**| | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **delimiter** | **String**| delimiter used to group common prefixes by | [optional] - **prefix** | **String**| return items prefixed with this value | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| a reference (could be either a branch or a commit ID) | | +| **userMetadata** | **Boolean**| | [optional] [default to true] | +| **presign** | **Boolean**| | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **delimiter** | **String**| delimiter used to group common prefixes by | [optional] | +| **prefix** | **String**| return items prefixed with this value | [optional] | ### Return type @@ -692,7 +708,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -702,31 +718,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object listing | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | object listing | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **stageObject** -> ObjectStats stageObject(repository, branch, path, objectStageCreation) +> ObjectStats stageObject(repository, branch, path, objectStageCreation).execute(); stage an object's metadata for the given branch ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -739,10 +755,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -755,13 +767,18 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String path = "path_example"; // String | relative to the branch ObjectStageCreation objectStageCreation = new ObjectStageCreation(); // ObjectStageCreation | try { - ObjectStats result = apiInstance.stageObject(repository, branch, path, objectStageCreation); + ObjectStats result = apiInstance.stageObject(repository, branch, path, objectStageCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#stageObject"); @@ -776,12 +793,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | - **objectStageCreation** | [**ObjectStageCreation**](ObjectStageCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | +| **objectStageCreation** | [**ObjectStageCreation**](ObjectStageCreation.md)| | | ### Return type @@ -789,7 +806,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -799,33 +816,33 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | object metadata | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - - +| **201** | object metadata | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | + + # **statObject** -> ObjectStats statObject(repository, ref, path, userMetadata, presign) +> ObjectStats statObject(repository, ref, path).userMetadata(userMetadata).presign(presign).execute(); get object metadata ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -838,10 +855,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -854,6 +867,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) @@ -861,7 +878,10 @@ public class Example { Boolean userMetadata = true; // Boolean | Boolean presign = true; // Boolean | try { - ObjectStats result = apiInstance.statObject(repository, ref, path, userMetadata, presign); + ObjectStats result = apiInstance.statObject(repository, ref, path) + .userMetadata(userMetadata) + .presign(presign) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#statObject"); @@ -876,13 +896,13 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| a reference (could be either a branch or a commit ID) | - **path** | **String**| relative to the branch | - **userMetadata** | **Boolean**| | [optional] [default to true] - **presign** | **Boolean**| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| a reference (could be either a branch or a commit ID) | | +| **path** | **String**| relative to the branch | | +| **userMetadata** | **Boolean**| | [optional] [default to true] | +| **presign** | **Boolean**| | [optional] | ### Return type @@ -890,7 +910,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -900,33 +920,33 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object metadata | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**400** | Bad Request | - | -**410** | object gone (but partial metadata may be available) | - | -**0** | Internal Server Error | - | - - +| **200** | object metadata | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **400** | Bad Request | - | +| **410** | object gone (but partial metadata may be available) | - | +| **0** | Internal Server Error | - | + + # **uploadObject** -> ObjectStats uploadObject(repository, branch, path, storageClass, ifNoneMatch, content) +> ObjectStats uploadObject(repository, branch, path).storageClass(storageClass).ifNoneMatch(ifNoneMatch).content(content).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.ObjectsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.ObjectsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -939,10 +959,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -955,6 +971,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + ObjectsApi apiInstance = new ObjectsApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | @@ -963,7 +983,11 @@ public class Example { String ifNoneMatch = "*"; // String | Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet File content = new File("/path/to/file"); // File | Only a single file per upload which must be named \\\"content\\\". try { - ObjectStats result = apiInstance.uploadObject(repository, branch, path, storageClass, ifNoneMatch, content); + ObjectStats result = apiInstance.uploadObject(repository, branch, path) + .storageClass(storageClass) + .ifNoneMatch(ifNoneMatch) + .content(content) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ObjectsApi#uploadObject"); @@ -978,14 +1002,14 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | - **storageClass** | **String**| | [optional] - **ifNoneMatch** | **String**| Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet | [optional] - **content** | **File**| Only a single file per upload which must be named \\\"content\\\". | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | +| **storageClass** | **String**| | [optional] | +| **ifNoneMatch** | **String**| Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet | [optional] | +| **content** | **File**| Only a single file per upload which must be named \\\"content\\\". | [optional] | ### Return type @@ -993,7 +1017,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -1003,11 +1027,11 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | object metadata | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**412** | Precondition Failed | - | -**0** | Internal Server Error | - | +| **201** | object metadata | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **412** | Precondition Failed | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/OtfDiffEntry.md b/clients/java/docs/OtfDiffEntry.md index 9972a585ef3..14d707f939e 100644 --- a/clients/java/docs/OtfDiffEntry.md +++ b/clients/java/docs/OtfDiffEntry.md @@ -5,23 +5,23 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**timestamp** | **Integer** | | -**operation** | **String** | | -**operationContent** | **Object** | free form content describing the returned operation diff | -**operationType** | [**OperationTypeEnum**](#OperationTypeEnum) | the operation category (CUD) | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**timestamp** | **Integer** | | | +|**operation** | **String** | | | +|**operationContent** | **Object** | free form content describing the returned operation diff | | +|**operationType** | [**OperationTypeEnum**](#OperationTypeEnum) | the operation category (CUD) | | ## Enum: OperationTypeEnum -Name | Value ----- | ----- -CREATE | "create" -UPDATE | "update" -DELETE | "delete" +| Name | Value | +|---- | -----| +| CREATE | "create" | +| UPDATE | "update" | +| DELETE | "delete" | diff --git a/clients/java/docs/OtfDiffList.md b/clients/java/docs/OtfDiffList.md index 56883308a52..16111e773db 100644 --- a/clients/java/docs/OtfDiffList.md +++ b/clients/java/docs/OtfDiffList.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**diffType** | [**DiffTypeEnum**](#DiffTypeEnum) | | [optional] -**results** | [**List<OtfDiffEntry>**](OtfDiffEntry.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**diffType** | [**DiffTypeEnum**](#DiffTypeEnum) | | [optional] | +|**results** | [**List<OtfDiffEntry>**](OtfDiffEntry.md) | | | ## Enum: DiffTypeEnum -Name | Value ----- | ----- -CREATED | "created" -DROPPED | "dropped" -CHANGED | "changed" +| Name | Value | +|---- | -----| +| CREATED | "created" | +| DROPPED | "dropped" | +| CHANGED | "changed" | diff --git a/clients/java/docs/Pagination.md b/clients/java/docs/Pagination.md index f4ca9a3a972..b6f782306f8 100644 --- a/clients/java/docs/Pagination.md +++ b/clients/java/docs/Pagination.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hasMore** | **Boolean** | Next page is available | -**nextOffset** | **String** | Token used to retrieve the next page | -**results** | **Integer** | Number of values found in the results | -**maxPerPage** | **Integer** | Maximal number of entries per page | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasMore** | **Boolean** | Next page is available | | +|**nextOffset** | **String** | Token used to retrieve the next page | | +|**results** | **Integer** | Number of values found in the results | | +|**maxPerPage** | **Integer** | Maximal number of entries per page | | diff --git a/clients/java/docs/PathList.md b/clients/java/docs/PathList.md index d4e84921d2a..27e14d980c9 100644 --- a/clients/java/docs/PathList.md +++ b/clients/java/docs/PathList.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**paths** | **List<String>** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paths** | **List<String>** | | | diff --git a/clients/java/docs/Policy.md b/clients/java/docs/Policy.md index 4f83f134c98..62b58a72f0d 100644 --- a/clients/java/docs/Policy.md +++ b/clients/java/docs/Policy.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | [optional] -**statement** | [**List<Statement>**](Statement.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | [optional] | +|**statement** | [**List<Statement>**](Statement.md) | | | diff --git a/clients/java/docs/PolicyList.md b/clients/java/docs/PolicyList.md index 4ca1e729ed5..244cda00d04 100644 --- a/clients/java/docs/PolicyList.md +++ b/clients/java/docs/PolicyList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Policy>**](Policy.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Policy>**](Policy.md) | | | diff --git a/clients/java/docs/PrepareGCUncommittedRequest.md b/clients/java/docs/PrepareGCUncommittedRequest.md index a117f5cda1b..ec0364d440d 100644 --- a/clients/java/docs/PrepareGCUncommittedRequest.md +++ b/clients/java/docs/PrepareGCUncommittedRequest.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**continuationToken** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**continuationToken** | **String** | | [optional] | diff --git a/clients/java/docs/PrepareGCUncommittedResponse.md b/clients/java/docs/PrepareGCUncommittedResponse.md index 372f18f64f4..1da59209364 100644 --- a/clients/java/docs/PrepareGCUncommittedResponse.md +++ b/clients/java/docs/PrepareGCUncommittedResponse.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runId** | **String** | | -**gcUncommittedLocation** | **String** | location of uncommitted information data | -**continuationToken** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**runId** | **String** | | | +|**gcUncommittedLocation** | **String** | location of uncommitted information data | | +|**continuationToken** | **String** | | [optional] | diff --git a/clients/java/docs/RangeMetadata.md b/clients/java/docs/RangeMetadata.md index e1cab3c8a52..2b782da2cc7 100644 --- a/clients/java/docs/RangeMetadata.md +++ b/clients/java/docs/RangeMetadata.md @@ -5,13 +5,13 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | ID of the range. | -**minKey** | **String** | First key in the range. | -**maxKey** | **String** | Last key in the range. | -**count** | **Integer** | Number of records in the range. | -**estimatedSize** | **Integer** | Estimated size of the range in bytes | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | ID of the range. | | +|**minKey** | **String** | First key in the range. | | +|**maxKey** | **String** | Last key in the range. | | +|**count** | **Integer** | Number of records in the range. | | +|**estimatedSize** | **Integer** | Estimated size of the range in bytes | | diff --git a/clients/java/docs/Ref.md b/clients/java/docs/Ref.md index 181ed2cbc4a..d064e590cdc 100644 --- a/clients/java/docs/Ref.md +++ b/clients/java/docs/Ref.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**commitId** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**commitId** | **String** | | | diff --git a/clients/java/docs/RefList.md b/clients/java/docs/RefList.md index 3acde5d5362..e8e9a379956 100644 --- a/clients/java/docs/RefList.md +++ b/clients/java/docs/RefList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Ref>**](Ref.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Ref>**](Ref.md) | | | diff --git a/clients/java/docs/RefsApi.md b/clients/java/docs/RefsApi.md index 276efd60002..c5957cc7af9 100644 --- a/clients/java/docs/RefsApi.md +++ b/clients/java/docs/RefsApi.md @@ -1,37 +1,37 @@ # RefsApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**diffRefs**](RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references -[**dumpRefs**](RefsApi.md#dumpRefs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store -[**findMergeBase**](RefsApi.md#findMergeBase) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references -[**logCommits**](RefsApi.md#logCommits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. -[**mergeIntoBranch**](RefsApi.md#mergeIntoBranch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references -[**restoreRefs**](RefsApi.md#restoreRefs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**diffRefs**](RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references | +| [**dumpRefs**](RefsApi.md#dumpRefs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store | +| [**findMergeBase**](RefsApi.md#findMergeBase) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references | +| [**logCommits**](RefsApi.md#logCommits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. | +| [**mergeIntoBranch**](RefsApi.md#mergeIntoBranch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references | +| [**restoreRefs**](RefsApi.md#restoreRefs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store | - + # **diffRefs** -> DiffList diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type) +> DiffList diffRefs(repository, leftRef, rightRef).after(after).amount(amount).prefix(prefix).delimiter(delimiter).type(type).execute(); diff references ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -44,10 +44,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -60,6 +56,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | String leftRef = "leftRef_example"; // String | a reference (could be either a branch or a commit ID) @@ -70,7 +70,13 @@ public class Example { String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by String type = "two_dot"; // String | try { - DiffList result = apiInstance.diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type); + DiffList result = apiInstance.diffRefs(repository, leftRef, rightRef) + .after(after) + .amount(amount) + .prefix(prefix) + .delimiter(delimiter) + .type(type) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#diffRefs"); @@ -85,16 +91,16 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **leftRef** | **String**| a reference (could be either a branch or a commit ID) | - **rightRef** | **String**| a reference (could be either a branch or a commit ID) to compare against | - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **prefix** | **String**| return items prefixed with this value | [optional] - **delimiter** | **String**| delimiter used to group common prefixes by | [optional] - **type** | **String**| | [optional] [default to three_dot] [enum: two_dot, three_dot] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **leftRef** | **String**| a reference (could be either a branch or a commit ID) | | +| **rightRef** | **String**| a reference (could be either a branch or a commit ID) to compare against | | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **delimiter** | **String**| delimiter used to group common prefixes by | [optional] | +| **type** | **String**| | [optional] [default to three_dot] [enum: two_dot, three_dot] | ### Return type @@ -102,7 +108,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -112,31 +118,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | diff between refs | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | diff between refs | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **dumpRefs** -> RefsDump dumpRefs(repository) +> RefsDump dumpRefs(repository).execute(); Dump repository refs (tags, commits, branches) to object store ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -149,10 +155,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -165,10 +167,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | try { - RefsDump result = apiInstance.dumpRefs(repository); + RefsDump result = apiInstance.dumpRefs(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#dumpRefs"); @@ -183,9 +190,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -193,7 +200,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -203,32 +210,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | refs dump | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | refs dump | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **findMergeBase** -> FindMergeBaseResult findMergeBase(repository, sourceRef, destinationBranch) +> FindMergeBaseResult findMergeBase(repository, sourceRef, destinationBranch).execute(); find the merge base for 2 references ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -241,10 +248,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -257,12 +260,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | String sourceRef = "sourceRef_example"; // String | source ref String destinationBranch = "destinationBranch_example"; // String | destination branch name try { - FindMergeBaseResult result = apiInstance.findMergeBase(repository, sourceRef, destinationBranch); + FindMergeBaseResult result = apiInstance.findMergeBase(repository, sourceRef, destinationBranch) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#findMergeBase"); @@ -277,11 +285,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **sourceRef** | **String**| source ref | - **destinationBranch** | **String**| destination branch name | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **sourceRef** | **String**| source ref | | +| **destinationBranch** | **String**| destination branch name | | ### Return type @@ -289,7 +297,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -299,32 +307,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Found the merge base | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | Found the merge base | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **logCommits** -> CommitList logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent) +> CommitList logCommits(repository, ref).after(after).amount(amount).objects(objects).prefixes(prefixes).limit(limit).firstParent(firstParent).execute(); get commit log from ref. If both objects and prefixes are empty, return all commits. ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -337,10 +345,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -353,6 +357,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | String ref = "ref_example"; // String | @@ -363,7 +371,14 @@ public class Example { Boolean limit = true; // Boolean | limit the number of items in return to 'amount'. Without further indication on actual number of items. Boolean firstParent = true; // Boolean | if set to true, follow only the first parent upon reaching a merge commit try { - CommitList result = apiInstance.logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent); + CommitList result = apiInstance.logCommits(repository, ref) + .after(after) + .amount(amount) + .objects(objects) + .prefixes(prefixes) + .limit(limit) + .firstParent(firstParent) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#logCommits"); @@ -378,16 +393,16 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **ref** | **String**| | - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] - **objects** | [**List<String>**](String.md)| list of paths, each element is a path of a specific object | [optional] - **prefixes** | [**List<String>**](String.md)| list of paths, each element is a path of a prefix | [optional] - **limit** | **Boolean**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] - **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **ref** | **String**| | | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | +| **objects** | [**List<String>**](String.md)| list of paths, each element is a path of a specific object | [optional] | +| **prefixes** | [**List<String>**](String.md)| list of paths, each element is a path of a prefix | [optional] | +| **limit** | **Boolean**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] | +| **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional] | ### Return type @@ -395,7 +410,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -405,31 +420,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | commit log | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | commit log | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **mergeIntoBranch** -> MergeResult mergeIntoBranch(repository, sourceRef, destinationBranch, merge) +> MergeResult mergeIntoBranch(repository, sourceRef, destinationBranch).merge(merge).execute(); merge references ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -442,10 +457,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -458,13 +469,19 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | String sourceRef = "sourceRef_example"; // String | source ref String destinationBranch = "destinationBranch_example"; // String | destination branch name Merge merge = new Merge(); // Merge | try { - MergeResult result = apiInstance.mergeIntoBranch(repository, sourceRef, destinationBranch, merge); + MergeResult result = apiInstance.mergeIntoBranch(repository, sourceRef, destinationBranch) + .merge(merge) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#mergeIntoBranch"); @@ -479,12 +496,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **sourceRef** | **String**| source ref | - **destinationBranch** | **String**| destination branch name | - **merge** | [**Merge**](Merge.md)| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **sourceRef** | **String**| source ref | | +| **destinationBranch** | **String**| destination branch name | | +| **merge** | [**Merge**](Merge.md)| | [optional] | ### Return type @@ -492,7 +509,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -502,35 +519,35 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | merge completed | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | -**412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | -**0** | Internal Server Error | - | - - +| **200** | merge completed | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | +| **412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +| **0** | Internal Server Error | - | + + # **restoreRefs** -> restoreRefs(repository, refsDump) +> restoreRefs(repository, refsDump).execute(); Restore repository refs (tags, commits, branches) from object store ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RefsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RefsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -543,10 +560,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -559,11 +572,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RefsApi apiInstance = new RefsApi(defaultClient); String repository = "repository_example"; // String | RefsDump refsDump = new RefsDump(); // RefsDump | try { - apiInstance.restoreRefs(repository, refsDump); + apiInstance.restoreRefs(repository, refsDump) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RefsApi#restoreRefs"); System.err.println("Status code: " + e.getCode()); @@ -577,10 +595,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **refsDump** | [**RefsDump**](RefsDump.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **refsDump** | [**RefsDump**](RefsDump.md)| | | ### Return type @@ -588,7 +606,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -598,9 +616,9 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | refs successfully loaded | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | refs successfully loaded | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/RefsDump.md b/clients/java/docs/RefsDump.md index 832abf289e1..b2d4805ae01 100644 --- a/clients/java/docs/RefsDump.md +++ b/clients/java/docs/RefsDump.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commitsMetaRangeId** | **String** | | -**tagsMetaRangeId** | **String** | | -**branchesMetaRangeId** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**commitsMetaRangeId** | **String** | | | +|**tagsMetaRangeId** | **String** | | | +|**branchesMetaRangeId** | **String** | | | diff --git a/clients/java/docs/RepositoriesApi.md b/clients/java/docs/RepositoriesApi.md index a067e93588a..2b316d37d66 100644 --- a/clients/java/docs/RepositoriesApi.md +++ b/clients/java/docs/RepositoriesApi.md @@ -1,39 +1,39 @@ # RepositoriesApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createBranchProtectionRule**](RepositoriesApi.md#createBranchProtectionRule) | **POST** /repositories/{repository}/branch_protection | -[**createRepository**](RepositoriesApi.md#createRepository) | **POST** /repositories | create repository -[**deleteBranchProtectionRule**](RepositoriesApi.md#deleteBranchProtectionRule) | **DELETE** /repositories/{repository}/branch_protection | -[**deleteRepository**](RepositoriesApi.md#deleteRepository) | **DELETE** /repositories/{repository} | delete repository -[**getBranchProtectionRules**](RepositoriesApi.md#getBranchProtectionRules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules -[**getRepository**](RepositoriesApi.md#getRepository) | **GET** /repositories/{repository} | get repository -[**getRepositoryMetadata**](RepositoriesApi.md#getRepositoryMetadata) | **GET** /repositories/{repository}/metadata | get repository metadata -[**listRepositories**](RepositoriesApi.md#listRepositories) | **GET** /repositories | list repositories +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createBranchProtectionRule**](RepositoriesApi.md#createBranchProtectionRule) | **POST** /repositories/{repository}/branch_protection | | +| [**createRepository**](RepositoriesApi.md#createRepository) | **POST** /repositories | create repository | +| [**deleteBranchProtectionRule**](RepositoriesApi.md#deleteBranchProtectionRule) | **DELETE** /repositories/{repository}/branch_protection | | +| [**deleteRepository**](RepositoriesApi.md#deleteRepository) | **DELETE** /repositories/{repository} | delete repository | +| [**getBranchProtectionRules**](RepositoriesApi.md#getBranchProtectionRules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules | +| [**getRepository**](RepositoriesApi.md#getRepository) | **GET** /repositories/{repository} | get repository | +| [**getRepositoryMetadata**](RepositoriesApi.md#getRepositoryMetadata) | **GET** /repositories/{repository}/metadata | get repository metadata | +| [**listRepositories**](RepositoriesApi.md#listRepositories) | **GET** /repositories | list repositories | - + # **createBranchProtectionRule** -> createBranchProtectionRule(repository, branchProtectionRule) +> createBranchProtectionRule(repository, branchProtectionRule).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -46,10 +46,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -62,11 +58,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | BranchProtectionRule branchProtectionRule = new BranchProtectionRule(); // BranchProtectionRule | try { - apiInstance.createBranchProtectionRule(repository, branchProtectionRule); + apiInstance.createBranchProtectionRule(repository, branchProtectionRule) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#createBranchProtectionRule"); System.err.println("Status code: " + e.getCode()); @@ -80,10 +81,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branchProtectionRule** | [**BranchProtectionRule**](BranchProtectionRule.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branchProtectionRule** | [**BranchProtectionRule**](BranchProtectionRule.md)| | | ### Return type @@ -91,7 +92,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -101,31 +102,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | branch protection rule created successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | branch protection rule created successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **createRepository** -> Repository createRepository(repositoryCreation, bare) +> Repository createRepository(repositoryCreation).bare(bare).execute(); create repository ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -138,10 +139,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -154,11 +151,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); RepositoryCreation repositoryCreation = new RepositoryCreation(); // RepositoryCreation | Boolean bare = false; // Boolean | If true, create a bare repository with no initial commit and branch try { - Repository result = apiInstance.createRepository(repositoryCreation, bare); + Repository result = apiInstance.createRepository(repositoryCreation) + .bare(bare) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#createRepository"); @@ -173,10 +176,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repositoryCreation** | [**RepositoryCreation**](RepositoryCreation.md)| | - **bare** | **Boolean**| If true, create a bare repository with no initial commit and branch | [optional] [default to false] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repositoryCreation** | [**RepositoryCreation**](RepositoryCreation.md)| | | +| **bare** | **Boolean**| If true, create a bare repository with no initial commit and branch | [optional] [default to false] | ### Return type @@ -184,7 +187,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -194,32 +197,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | repository | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | +| **201** | repository | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | - + # **deleteBranchProtectionRule** -> deleteBranchProtectionRule(repository, inlineObject1) +> deleteBranchProtectionRule(repository, deleteBranchProtectionRuleRequest).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -232,10 +235,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -248,11 +247,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | - InlineObject1 inlineObject1 = new InlineObject1(); // InlineObject1 | + DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest = new DeleteBranchProtectionRuleRequest(); // DeleteBranchProtectionRuleRequest | try { - apiInstance.deleteBranchProtectionRule(repository, inlineObject1); + apiInstance.deleteBranchProtectionRule(repository, deleteBranchProtectionRuleRequest) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#deleteBranchProtectionRule"); System.err.println("Status code: " + e.getCode()); @@ -266,10 +270,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **inlineObject1** | [**InlineObject1**](InlineObject1.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **deleteBranchProtectionRuleRequest** | [**DeleteBranchProtectionRuleRequest**](DeleteBranchProtectionRuleRequest.md)| | | ### Return type @@ -277,7 +281,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -287,31 +291,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | branch protection rule deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | branch protection rule deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **deleteRepository** -> deleteRepository(repository) +> deleteRepository(repository).execute(); delete repository ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -324,10 +328,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -340,10 +340,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | try { - apiInstance.deleteRepository(repository); + apiInstance.deleteRepository(repository) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#deleteRepository"); System.err.println("Status code: " + e.getCode()); @@ -357,9 +362,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -367,7 +372,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -377,31 +382,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | repository deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | repository deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getBranchProtectionRules** -> List<BranchProtectionRule> getBranchProtectionRules(repository) +> List<BranchProtectionRule> getBranchProtectionRules(repository).execute(); get branch protection rules ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -414,10 +419,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -430,10 +431,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | try { - List result = apiInstance.getBranchProtectionRules(repository); + List result = apiInstance.getBranchProtectionRules(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#getBranchProtectionRules"); @@ -448,9 +454,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -458,7 +464,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -468,31 +474,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | branch protection rules | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | branch protection rules | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getRepository** -> Repository getRepository(repository) +> Repository getRepository(repository).execute(); get repository ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -505,10 +511,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -521,10 +523,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | try { - Repository result = apiInstance.getRepository(repository); + Repository result = apiInstance.getRepository(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#getRepository"); @@ -539,9 +546,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -549,7 +556,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -559,31 +566,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | repository | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | repository | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getRepositoryMetadata** -> Map<String, String> getRepositoryMetadata(repository) +> Map<String, String> getRepositoryMetadata(repository).execute(); get repository metadata ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -596,10 +603,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -612,10 +615,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String repository = "repository_example"; // String | try { - Map result = apiInstance.getRepositoryMetadata(repository); + Map result = apiInstance.getRepositoryMetadata(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#getRepositoryMetadata"); @@ -630,9 +638,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -640,7 +648,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -650,31 +658,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | repository metadata | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | repository metadata | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listRepositories** -> RepositoryList listRepositories(prefix, after, amount) +> RepositoryList listRepositories().prefix(prefix).after(after).amount(amount).execute(); list repositories ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RepositoriesApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RepositoriesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -687,10 +695,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -703,12 +707,20 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RepositoriesApi apiInstance = new RepositoriesApi(defaultClient); String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - RepositoryList result = apiInstance.listRepositories(prefix, after, amount); + RepositoryList result = apiInstance.listRepositories() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoriesApi#listRepositories"); @@ -723,11 +735,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -735,7 +747,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -745,7 +757,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | repository list | - | -**401** | Unauthorized | - | -**0** | Internal Server Error | - | +| **200** | repository list | - | +| **401** | Unauthorized | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/Repository.md b/clients/java/docs/Repository.md index a394d75cdc0..8fd57838532 100644 --- a/clients/java/docs/Repository.md +++ b/clients/java/docs/Repository.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**creationDate** | **Long** | Unix Epoch in seconds | -**defaultBranch** | **String** | | -**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**creationDate** | **Long** | Unix Epoch in seconds | | +|**defaultBranch** | **String** | | | +|**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | | diff --git a/clients/java/docs/RepositoryCreation.md b/clients/java/docs/RepositoryCreation.md index b12b883e255..571ed5a7822 100644 --- a/clients/java/docs/RepositoryCreation.md +++ b/clients/java/docs/RepositoryCreation.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | -**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | -**defaultBranch** | **String** | | [optional] -**sampleData** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | | +|**defaultBranch** | **String** | | [optional] | +|**sampleData** | **Boolean** | | [optional] | diff --git a/clients/java/docs/RepositoryList.md b/clients/java/docs/RepositoryList.md index 84971056d79..f3a043666b6 100644 --- a/clients/java/docs/RepositoryList.md +++ b/clients/java/docs/RepositoryList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<Repository>**](Repository.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<Repository>**](Repository.md) | | | diff --git a/clients/java/docs/ResetCreation.md b/clients/java/docs/ResetCreation.md index b8f4d1c39c4..2df7c893a92 100644 --- a/clients/java/docs/ResetCreation.md +++ b/clients/java/docs/ResetCreation.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**TypeEnum**](#TypeEnum) | | -**path** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**path** | **String** | | [optional] | ## Enum: TypeEnum -Name | Value ----- | ----- -OBJECT | "object" -COMMON_PREFIX | "common_prefix" -RESET | "reset" +| Name | Value | +|---- | -----| +| OBJECT | "object" | +| COMMON_PREFIX | "common_prefix" | +| RESET | "reset" | diff --git a/clients/java/docs/RetentionApi.md b/clients/java/docs/RetentionApi.md index 898dcad9ff3..7157f40ac10 100644 --- a/clients/java/docs/RetentionApi.md +++ b/clients/java/docs/RetentionApi.md @@ -1,36 +1,36 @@ # RetentionApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteGarbageCollectionRules**](RetentionApi.md#deleteGarbageCollectionRules) | **DELETE** /repositories/{repository}/gc/rules | -[**getGarbageCollectionRules**](RetentionApi.md#getGarbageCollectionRules) | **GET** /repositories/{repository}/gc/rules | -[**prepareGarbageCollectionCommits**](RetentionApi.md#prepareGarbageCollectionCommits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active commits for garbage collection -[**prepareGarbageCollectionUncommitted**](RetentionApi.md#prepareGarbageCollectionUncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection -[**setGarbageCollectionRules**](RetentionApi.md#setGarbageCollectionRules) | **POST** /repositories/{repository}/gc/rules | +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteGarbageCollectionRules**](RetentionApi.md#deleteGarbageCollectionRules) | **DELETE** /repositories/{repository}/gc/rules | | +| [**getGarbageCollectionRules**](RetentionApi.md#getGarbageCollectionRules) | **GET** /repositories/{repository}/gc/rules | | +| [**prepareGarbageCollectionCommits**](RetentionApi.md#prepareGarbageCollectionCommits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active commits for garbage collection | +| [**prepareGarbageCollectionUncommitted**](RetentionApi.md#prepareGarbageCollectionUncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection | +| [**setGarbageCollectionRules**](RetentionApi.md#setGarbageCollectionRules) | **POST** /repositories/{repository}/gc/rules | | - + # **deleteGarbageCollectionRules** -> deleteGarbageCollectionRules(repository) +> deleteGarbageCollectionRules(repository).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RetentionApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RetentionApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -43,10 +43,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -59,10 +55,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RetentionApi apiInstance = new RetentionApi(defaultClient); String repository = "repository_example"; // String | try { - apiInstance.deleteGarbageCollectionRules(repository); + apiInstance.deleteGarbageCollectionRules(repository) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RetentionApi#deleteGarbageCollectionRules"); System.err.println("Status code: " + e.getCode()); @@ -76,9 +77,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -86,7 +87,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -96,31 +97,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | deleted garbage collection rules successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | deleted garbage collection rules successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getGarbageCollectionRules** -> GarbageCollectionRules getGarbageCollectionRules(repository) +> GarbageCollectionRules getGarbageCollectionRules(repository).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RetentionApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RetentionApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -133,10 +134,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -149,10 +146,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RetentionApi apiInstance = new RetentionApi(defaultClient); String repository = "repository_example"; // String | try { - GarbageCollectionRules result = apiInstance.getGarbageCollectionRules(repository); + GarbageCollectionRules result = apiInstance.getGarbageCollectionRules(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RetentionApi#getGarbageCollectionRules"); @@ -167,9 +169,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -177,7 +179,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -187,31 +189,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | gc rule list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | gc rule list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **prepareGarbageCollectionCommits** -> GarbageCollectionPrepareResponse prepareGarbageCollectionCommits(repository) +> GarbageCollectionPrepareResponse prepareGarbageCollectionCommits(repository).execute(); save lists of active commits for garbage collection ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RetentionApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RetentionApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -224,10 +226,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -240,10 +238,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RetentionApi apiInstance = new RetentionApi(defaultClient); String repository = "repository_example"; // String | try { - GarbageCollectionPrepareResponse result = apiInstance.prepareGarbageCollectionCommits(repository); + GarbageCollectionPrepareResponse result = apiInstance.prepareGarbageCollectionCommits(repository) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RetentionApi#prepareGarbageCollectionCommits"); @@ -258,9 +261,9 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | ### Return type @@ -268,7 +271,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -278,31 +281,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | paths to commit dataset | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | paths to commit dataset | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **prepareGarbageCollectionUncommitted** -> PrepareGCUncommittedResponse prepareGarbageCollectionUncommitted(repository, prepareGCUncommittedRequest) +> PrepareGCUncommittedResponse prepareGarbageCollectionUncommitted(repository).prepareGCUncommittedRequest(prepareGCUncommittedRequest).execute(); save repository uncommitted metadata for garbage collection ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RetentionApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RetentionApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -315,10 +318,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -331,11 +330,17 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RetentionApi apiInstance = new RetentionApi(defaultClient); String repository = "repository_example"; // String | PrepareGCUncommittedRequest prepareGCUncommittedRequest = new PrepareGCUncommittedRequest(); // PrepareGCUncommittedRequest | try { - PrepareGCUncommittedResponse result = apiInstance.prepareGarbageCollectionUncommitted(repository, prepareGCUncommittedRequest); + PrepareGCUncommittedResponse result = apiInstance.prepareGarbageCollectionUncommitted(repository) + .prepareGCUncommittedRequest(prepareGCUncommittedRequest) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RetentionApi#prepareGarbageCollectionUncommitted"); @@ -350,10 +355,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **prepareGCUncommittedRequest** | [**PrepareGCUncommittedRequest**](PrepareGCUncommittedRequest.md)| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **prepareGCUncommittedRequest** | [**PrepareGCUncommittedRequest**](PrepareGCUncommittedRequest.md)| | [optional] | ### Return type @@ -361,7 +366,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -371,32 +376,32 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | paths to commit dataset | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **201** | paths to commit dataset | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **setGarbageCollectionRules** -> setGarbageCollectionRules(repository, garbageCollectionRules) +> setGarbageCollectionRules(repository, garbageCollectionRules).execute(); ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.RetentionApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.RetentionApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -409,10 +414,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -425,11 +426,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + RetentionApi apiInstance = new RetentionApi(defaultClient); String repository = "repository_example"; // String | GarbageCollectionRules garbageCollectionRules = new GarbageCollectionRules(); // GarbageCollectionRules | try { - apiInstance.setGarbageCollectionRules(repository, garbageCollectionRules); + apiInstance.setGarbageCollectionRules(repository, garbageCollectionRules) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling RetentionApi#setGarbageCollectionRules"); System.err.println("Status code: " + e.getCode()); @@ -443,10 +449,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **garbageCollectionRules** | [**GarbageCollectionRules**](GarbageCollectionRules.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **garbageCollectionRules** | [**GarbageCollectionRules**](GarbageCollectionRules.md)| | | ### Return type @@ -454,7 +460,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -464,8 +470,8 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | set garbage collection rules successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | set garbage collection rules successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/RevertCreation.md b/clients/java/docs/RevertCreation.md index 6b61850abbb..5b87d4ff7ce 100644 --- a/clients/java/docs/RevertCreation.md +++ b/clients/java/docs/RevertCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ref** | **String** | the commit to revert, given by a ref | -**parentNumber** | **Integer** | when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ref** | **String** | the commit to revert, given by a ref | | +|**parentNumber** | **Integer** | when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. | | diff --git a/clients/java/docs/Setup.md b/clients/java/docs/Setup.md index a8940098dcc..abeab60309b 100644 --- a/clients/java/docs/Setup.md +++ b/clients/java/docs/Setup.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **String** | an identifier for the user (e.g. jane.doe) | -**key** | [**AccessKeyCredentials**](AccessKeyCredentials.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | an identifier for the user (e.g. jane.doe) | | +|**key** | [**AccessKeyCredentials**](AccessKeyCredentials.md) | | [optional] | diff --git a/clients/java/docs/SetupState.md b/clients/java/docs/SetupState.md index f7e6b3e4190..f1aaaf38aa7 100644 --- a/clients/java/docs/SetupState.md +++ b/clients/java/docs/SetupState.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**state** | [**StateEnum**](#StateEnum) | | [optional] -**commPrefsMissing** | **Boolean** | true if the comm prefs are missing. | [optional] -**loginConfig** | [**LoginConfig**](LoginConfig.md) | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**state** | [**StateEnum**](#StateEnum) | | [optional] | +|**commPrefsMissing** | **Boolean** | true if the comm prefs are missing. | [optional] | +|**loginConfig** | [**LoginConfig**](LoginConfig.md) | | [optional] | ## Enum: StateEnum -Name | Value ----- | ----- -INITIALIZED | "initialized" -NOT_INITIALIZED | "not_initialized" +| Name | Value | +|---- | -----| +| INITIALIZED | "initialized" | +| NOT_INITIALIZED | "not_initialized" | diff --git a/clients/java/docs/StagingApi.md b/clients/java/docs/StagingApi.md index 7ffb19e38b8..531dcf36be4 100644 --- a/clients/java/docs/StagingApi.md +++ b/clients/java/docs/StagingApi.md @@ -1,33 +1,33 @@ # StagingApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getPhysicalAddress**](StagingApi.md#getPhysicalAddress) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage -[**linkPhysicalAddress**](StagingApi.md#linkPhysicalAddress) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getPhysicalAddress**](StagingApi.md#getPhysicalAddress) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage | +| [**linkPhysicalAddress**](StagingApi.md#linkPhysicalAddress) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path | - + # **getPhysicalAddress** -> StagingLocation getPhysicalAddress(repository, branch, path, presign) +> StagingLocation getPhysicalAddress(repository, branch, path).presign(presign).execute(); get a physical address and a return token to write object to underlying storage ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.StagingApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.StagingApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -40,10 +40,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -56,13 +52,19 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + StagingApi apiInstance = new StagingApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String path = "path_example"; // String | relative to the branch Boolean presign = true; // Boolean | try { - StagingLocation result = apiInstance.getPhysicalAddress(repository, branch, path, presign); + StagingLocation result = apiInstance.getPhysicalAddress(repository, branch, path) + .presign(presign) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StagingApi#getPhysicalAddress"); @@ -77,12 +79,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | - **presign** | **Boolean**| | [optional] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | +| **presign** | **Boolean**| | [optional] | ### Return type @@ -90,7 +92,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -100,14 +102,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | physical address for staging area | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | physical address for staging area | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **linkPhysicalAddress** -> ObjectStats linkPhysicalAddress(repository, branch, path, stagingMetadata) +> ObjectStats linkPhysicalAddress(repository, branch, path, stagingMetadata).execute(); associate staging on this physical address with a path @@ -116,17 +118,17 @@ If the supplied token matches the current staging token, associate the object as ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.StagingApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.StagingApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -139,10 +141,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -155,13 +153,18 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + StagingApi apiInstance = new StagingApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | String path = "path_example"; // String | relative to the branch StagingMetadata stagingMetadata = new StagingMetadata(); // StagingMetadata | try { - ObjectStats result = apiInstance.linkPhysicalAddress(repository, branch, path, stagingMetadata); + ObjectStats result = apiInstance.linkPhysicalAddress(repository, branch, path, stagingMetadata) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StagingApi#linkPhysicalAddress"); @@ -176,12 +179,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **path** | **String**| relative to the branch | - **stagingMetadata** | [**StagingMetadata**](StagingMetadata.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **path** | **String**| relative to the branch | | +| **stagingMetadata** | [**StagingMetadata**](StagingMetadata.md)| | | ### Return type @@ -189,7 +192,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -199,10 +202,10 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | object metadata | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Internal Server Error | - | -**409** | conflict with a commit, try here | - | -**0** | Internal Server Error | - | +| **200** | object metadata | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Internal Server Error | - | +| **409** | conflict with a commit, try here | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/StagingLocation.md b/clients/java/docs/StagingLocation.md index aa20403bec4..557d94ace22 100644 --- a/clients/java/docs/StagingLocation.md +++ b/clients/java/docs/StagingLocation.md @@ -6,12 +6,12 @@ location for placing an object when staging it ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**physicalAddress** | **String** | | [optional] -**token** | **String** | opaque staging token to use to link uploaded object | -**presignedUrl** | **String** | if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading | [optional] -**presignedUrlExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**physicalAddress** | **String** | | [optional] | +|**token** | **String** | opaque staging token to use to link uploaded object | | +|**presignedUrl** | **String** | if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading | [optional] | +|**presignedUrlExpiry** | **Long** | If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. | [optional] | diff --git a/clients/java/docs/StagingMetadata.md b/clients/java/docs/StagingMetadata.md index 569e5edbeca..f8ef784d31c 100644 --- a/clients/java/docs/StagingMetadata.md +++ b/clients/java/docs/StagingMetadata.md @@ -6,13 +6,13 @@ information about uploaded object ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**staging** | [**StagingLocation**](StagingLocation.md) | | -**checksum** | **String** | unique identifier of object content on backing store (typically ETag) | -**sizeBytes** | **Long** | | -**userMetadata** | **Map<String, String>** | | [optional] -**contentType** | **String** | Object media type | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**staging** | [**StagingLocation**](StagingLocation.md) | | | +|**checksum** | **String** | unique identifier of object content on backing store (typically ETag) | | +|**sizeBytes** | **Long** | | | +|**userMetadata** | **Map<String, String>** | | [optional] | +|**contentType** | **String** | Object media type | [optional] | diff --git a/clients/java/docs/Statement.md b/clients/java/docs/Statement.md index c95e6d3770c..ccef2c1a7f2 100644 --- a/clients/java/docs/Statement.md +++ b/clients/java/docs/Statement.md @@ -5,20 +5,20 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**effect** | [**EffectEnum**](#EffectEnum) | | -**resource** | **String** | | -**action** | **List<String>** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**effect** | [**EffectEnum**](#EffectEnum) | | | +|**resource** | **String** | | | +|**action** | **List<String>** | | | ## Enum: EffectEnum -Name | Value ----- | ----- -ALLOW | "allow" -DENY | "deny" +| Name | Value | +|---- | -----| +| ALLOW | "allow" | +| DENY | "deny" | diff --git a/clients/java/docs/StatsEvent.md b/clients/java/docs/StatsEvent.md index c1de16909c5..becac2ed33b 100644 --- a/clients/java/docs/StatsEvent.md +++ b/clients/java/docs/StatsEvent.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyClass** | **String** | stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\") | -**name** | **String** | stats event name (e.g. \"put_object\", \"create_repository\", \"<experimental-feature-name>\") | -**count** | **Integer** | number of events of the class and name | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\") | | +|**name** | **String** | stats event name (e.g. \"put_object\", \"create_repository\", \"<experimental-feature-name>\") | | +|**count** | **Integer** | number of events of the class and name | | diff --git a/clients/java/docs/StatsEventsList.md b/clients/java/docs/StatsEventsList.md index 331b12f6df6..a696adf560c 100644 --- a/clients/java/docs/StatsEventsList.md +++ b/clients/java/docs/StatsEventsList.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**List<StatsEvent>**](StatsEvent.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**List<StatsEvent>**](StatsEvent.md) | | | diff --git a/clients/java/docs/StorageConfig.md b/clients/java/docs/StorageConfig.md index 6f176a63b5e..28491ed74e0 100644 --- a/clients/java/docs/StorageConfig.md +++ b/clients/java/docs/StorageConfig.md @@ -5,16 +5,16 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**blockstoreType** | **String** | | -**blockstoreNamespaceExample** | **String** | | -**blockstoreNamespaceValidityRegex** | **String** | | -**defaultNamespacePrefix** | **String** | | [optional] -**preSignSupport** | **Boolean** | | -**preSignSupportUi** | **Boolean** | | -**importSupport** | **Boolean** | | -**importValidityRegex** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blockstoreType** | **String** | | | +|**blockstoreNamespaceExample** | **String** | | | +|**blockstoreNamespaceValidityRegex** | **String** | | | +|**defaultNamespacePrefix** | **String** | | [optional] | +|**preSignSupport** | **Boolean** | | | +|**preSignSupportUi** | **Boolean** | | | +|**importSupport** | **Boolean** | | | +|**importValidityRegex** | **String** | | | diff --git a/clients/java/docs/StorageURI.md b/clients/java/docs/StorageURI.md index e890eae4d13..2ff4a26269a 100644 --- a/clients/java/docs/StorageURI.md +++ b/clients/java/docs/StorageURI.md @@ -6,9 +6,9 @@ URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**location** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**location** | **String** | | | diff --git a/clients/java/docs/TagCreation.md b/clients/java/docs/TagCreation.md index ee60d98d41a..fcb7bc61421 100644 --- a/clients/java/docs/TagCreation.md +++ b/clients/java/docs/TagCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**ref** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**ref** | **String** | | | diff --git a/clients/java/docs/TagsApi.md b/clients/java/docs/TagsApi.md index 1ca1ae90ac2..c151b384a1a 100644 --- a/clients/java/docs/TagsApi.md +++ b/clients/java/docs/TagsApi.md @@ -1,35 +1,35 @@ # TagsApi -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createTag**](TagsApi.md#createTag) | **POST** /repositories/{repository}/tags | create tag -[**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag -[**getTag**](TagsApi.md#getTag) | **GET** /repositories/{repository}/tags/{tag} | get tag -[**listTags**](TagsApi.md#listTags) | **GET** /repositories/{repository}/tags | list tags +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createTag**](TagsApi.md#createTag) | **POST** /repositories/{repository}/tags | create tag | +| [**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag | +| [**getTag**](TagsApi.md#getTag) | **GET** /repositories/{repository}/tags/{tag} | get tag | +| [**listTags**](TagsApi.md#listTags) | **GET** /repositories/{repository}/tags | list tags | - + # **createTag** -> Ref createTag(repository, tagCreation) +> Ref createTag(repository, tagCreation).execute(); create tag ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.TagsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.TagsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -42,10 +42,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -58,11 +54,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + TagsApi apiInstance = new TagsApi(defaultClient); String repository = "repository_example"; // String | TagCreation tagCreation = new TagCreation(); // TagCreation | try { - Ref result = apiInstance.createTag(repository, tagCreation); + Ref result = apiInstance.createTag(repository, tagCreation) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TagsApi#createTag"); @@ -77,10 +78,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **tagCreation** | [**TagCreation**](TagCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **tagCreation** | [**TagCreation**](TagCreation.md)| | | ### Return type @@ -88,7 +89,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -98,33 +99,33 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | tag | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | - - +| **201** | tag | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **0** | Internal Server Error | - | + + # **deleteTag** -> deleteTag(repository, tag) +> deleteTag(repository, tag).execute(); delete tag ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.TagsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.TagsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -137,10 +138,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -153,11 +150,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + TagsApi apiInstance = new TagsApi(defaultClient); String repository = "repository_example"; // String | String tag = "tag_example"; // String | try { - apiInstance.deleteTag(repository, tag); + apiInstance.deleteTag(repository, tag) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling TagsApi#deleteTag"); System.err.println("Status code: " + e.getCode()); @@ -171,10 +173,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **tag** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **tag** | **String**| | | ### Return type @@ -182,7 +184,7 @@ null (empty response body) ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -192,31 +194,31 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | tag deleted successfully | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **204** | tag deleted successfully | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **getTag** -> Ref getTag(repository, tag) +> Ref getTag(repository, tag).execute(); get tag ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.TagsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.TagsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -229,10 +231,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -245,11 +243,16 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + TagsApi apiInstance = new TagsApi(defaultClient); String repository = "repository_example"; // String | String tag = "tag_example"; // String | try { - Ref result = apiInstance.getTag(repository, tag); + Ref result = apiInstance.getTag(repository, tag) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TagsApi#getTag"); @@ -264,10 +267,10 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **tag** | **String**| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **tag** | **String**| | | ### Return type @@ -275,7 +278,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -285,31 +288,31 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | tag | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | tag | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | - + # **listTags** -> RefList listTags(repository, prefix, after, amount) +> RefList listTags(repository).prefix(prefix).after(after).amount(amount).execute(); list tags ### Example ```java // Import classes: -import io.lakefs.clients.api.ApiClient; -import io.lakefs.clients.api.ApiException; -import io.lakefs.clients.api.Configuration; -import io.lakefs.clients.api.auth.*; -import io.lakefs.clients.api.models.*; -import io.lakefs.clients.api.TagsApi; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.auth.*; +import io.lakefs.clients.sdk.models.*; +import io.lakefs.clients.sdk.TagsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -322,10 +325,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -338,13 +337,21 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + TagsApi apiInstance = new TagsApi(defaultClient); String repository = "repository_example"; // String | String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return try { - RefList result = apiInstance.listTags(repository, prefix, after, amount); + RefList result = apiInstance.listTags(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TagsApi#listTags"); @@ -359,12 +366,12 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **prefix** | **String**| return items prefixed with this value | [optional] - **after** | **String**| return items after this value | [optional] - **amount** | **Integer**| how many items to return | [optional] [default to 100] +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **prefix** | **String**| return items prefixed with this value | [optional] | +| **after** | **String**| return items after this value | [optional] | +| **amount** | **Integer**| how many items to return | [optional] [default to 100] | ### Return type @@ -372,7 +379,7 @@ Name | Type | Description | Notes ### Authorization -[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) +[basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) ### HTTP request headers @@ -382,8 +389,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | tag list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | +| **200** | tag list | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **0** | Internal Server Error | - | diff --git a/clients/java/docs/UnderlyingObjectProperties.md b/clients/java/docs/UnderlyingObjectProperties.md index f9be999984a..d3abc8fb19b 100644 --- a/clients/java/docs/UnderlyingObjectProperties.md +++ b/clients/java/docs/UnderlyingObjectProperties.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**storageClass** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**storageClass** | **String** | | [optional] | diff --git a/clients/java/docs/UpdateToken.md b/clients/java/docs/UpdateToken.md index 76520c19779..fe415dc92e6 100644 --- a/clients/java/docs/UpdateToken.md +++ b/clients/java/docs/UpdateToken.md @@ -5,9 +5,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stagingToken** | **String** | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stagingToken** | **String** | | | diff --git a/clients/java/docs/User.md b/clients/java/docs/User.md index fe543e554df..660c90d4712 100644 --- a/clients/java/docs/User.md +++ b/clients/java/docs/User.md @@ -5,11 +5,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | a unique identifier for the user. | -**creationDate** | **Long** | Unix Epoch in seconds | -**friendlyName** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | a unique identifier for the user. | | +|**creationDate** | **Long** | Unix Epoch in seconds | | +|**friendlyName** | **String** | | [optional] | diff --git a/clients/java/docs/UserCreation.md b/clients/java/docs/UserCreation.md index 12d8a5af0a7..f55ce35404c 100644 --- a/clients/java/docs/UserCreation.md +++ b/clients/java/docs/UserCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | a unique identifier for the user. | -**inviteUser** | **Boolean** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | a unique identifier for the user. | | +|**inviteUser** | **Boolean** | | [optional] | diff --git a/clients/java/docs/UserList.md b/clients/java/docs/UserList.md index b60eea08366..b9d8c421208 100644 --- a/clients/java/docs/UserList.md +++ b/clients/java/docs/UserList.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | -**results** | [**List<User>**](User.md) | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<User>**](User.md) | | | diff --git a/clients/java/docs/VersionConfig.md b/clients/java/docs/VersionConfig.md index 60716f23596..d348248b66d 100644 --- a/clients/java/docs/VersionConfig.md +++ b/clients/java/docs/VersionConfig.md @@ -5,12 +5,12 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**version** | **String** | | [optional] -**latestVersion** | **String** | | [optional] -**upgradeRecommended** | **Boolean** | | [optional] -**upgradeUrl** | **String** | | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**version** | **String** | | [optional] | +|**latestVersion** | **String** | | [optional] | +|**upgradeRecommended** | **Boolean** | | [optional] | +|**upgradeUrl** | **String** | | [optional] | diff --git a/clients/java/pom.xml b/clients/java/pom.xml index 5d823e368e4..0c1aa1a69e4 100644 --- a/clients/java/pom.xml +++ b/clients/java/pom.xml @@ -2,9 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 io.lakefs - api-client + sdk-client jar - api-client + sdk-client 0.1.0-SNAPSHOT https://lakefs.io lakeFS OpenAPI Java client @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M4 + 2.22.2 @@ -87,9 +87,18 @@ methods 10 + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin + 3.3.0 package @@ -102,16 +111,14 @@ - org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -119,11 +126,10 @@ - org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.3.0 add_sources @@ -154,7 +160,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.4.1 attach-javadocs @@ -177,7 +183,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources @@ -187,6 +193,48 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + @@ -198,7 +246,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -215,11 +263,6 @@ - - io.swagger - swagger-annotations - ${swagger-core-version} - com.google.code.findbugs @@ -251,11 +294,6 @@ commons-lang3 ${commons-lang3-version} - - org.threeten - threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -267,33 +305,53 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + org.mockito mockito-core - 3.11.2 + ${mockito-core-version} test - 1.7 + 1.8 ${java.version} ${java.version} 1.8.5 - 1.6.2 - 4.9.1 - 2.8.6 - 3.11 - 0.2.1 - 1.5.0 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 1.3.5 - 4.13.1 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 UTF-8 + 2.27.2 diff --git a/clients/java/settings.gradle b/clients/java/settings.gradle index 5d37c7c9cc6..3622eaedd5a 100644 --- a/clients/java/settings.gradle +++ b/clients/java/settings.gradle @@ -1 +1 @@ -rootProject.name = "api-client" \ No newline at end of file +rootProject.name = "sdk-client" \ No newline at end of file diff --git a/clients/java/src/main/AndroidManifest.xml b/clients/java/src/main/AndroidManifest.xml index 3cd2967e7be..d8bce2c08d4 100644 --- a/clients/java/src/main/AndroidManifest.xml +++ b/clients/java/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ - + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ActionsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ActionsApi.java new file mode 100644 index 00000000000..73707b1576b --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ActionsApi.java @@ -0,0 +1,874 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.ActionRun; +import io.lakefs.clients.sdk.model.ActionRunList; +import io.lakefs.clients.sdk.model.Error; +import java.io.File; +import io.lakefs.clients.sdk.model.HookRunList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ActionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ActionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ActionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call getRunCall(String repository, String runId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/actions/runs/{run_id}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "run_id" + "}", localVarApiClient.escapeString(runId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRunValidateBeforeCall(String repository, String runId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getRun(Async)"); + } + + // verify the required parameter 'runId' is set + if (runId == null) { + throw new ApiException("Missing the required parameter 'runId' when calling getRun(Async)"); + } + + return getRunCall(repository, runId, _callback); + + } + + + private ApiResponse getRunWithHttpInfo(String repository, String runId) throws ApiException { + okhttp3.Call localVarCall = getRunValidateBeforeCall(repository, runId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getRunAsync(String repository, String runId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getRunValidateBeforeCall(repository, runId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetRunRequest { + private final String repository; + private final String runId; + + private APIgetRunRequest(String repository, String runId) { + this.repository = repository; + this.runId = runId; + } + + /** + * Build call for getRun + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 action run result -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getRunCall(repository, runId, _callback); + } + + /** + * Execute getRun request + * @return ActionRun + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 action run result -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ActionRun execute() throws ApiException { + ApiResponse localVarResp = getRunWithHttpInfo(repository, runId); + return localVarResp.getData(); + } + + /** + * Execute getRun request with HTTP info returned + * @return ApiResponse<ActionRun> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 action run result -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getRunWithHttpInfo(repository, runId); + } + + /** + * Execute getRun request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 action run result -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getRunAsync(repository, runId, _callback); + } + } + + /** + * get a run + * + * @param repository (required) + * @param runId (required) + * @return APIgetRunRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 action run result -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetRunRequest getRun(String repository, String runId) { + return new APIgetRunRequest(repository, runId); + } + private okhttp3.Call getRunHookOutputCall(String repository, String runId, String hookRunId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "run_id" + "}", localVarApiClient.escapeString(runId.toString())) + .replace("{" + "hook_run_id" + "}", localVarApiClient.escapeString(hookRunId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/octet-stream", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRunHookOutputValidateBeforeCall(String repository, String runId, String hookRunId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getRunHookOutput(Async)"); + } + + // verify the required parameter 'runId' is set + if (runId == null) { + throw new ApiException("Missing the required parameter 'runId' when calling getRunHookOutput(Async)"); + } + + // verify the required parameter 'hookRunId' is set + if (hookRunId == null) { + throw new ApiException("Missing the required parameter 'hookRunId' when calling getRunHookOutput(Async)"); + } + + return getRunHookOutputCall(repository, runId, hookRunId, _callback); + + } + + + private ApiResponse getRunHookOutputWithHttpInfo(String repository, String runId, String hookRunId) throws ApiException { + okhttp3.Call localVarCall = getRunHookOutputValidateBeforeCall(repository, runId, hookRunId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getRunHookOutputAsync(String repository, String runId, String hookRunId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getRunHookOutputValidateBeforeCall(repository, runId, hookRunId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetRunHookOutputRequest { + private final String repository; + private final String runId; + private final String hookRunId; + + private APIgetRunHookOutputRequest(String repository, String runId, String hookRunId) { + this.repository = repository; + this.runId = runId; + this.hookRunId = hookRunId; + } + + /** + * Build call for getRunHookOutput + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 run hook output -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getRunHookOutputCall(repository, runId, hookRunId, _callback); + } + + /** + * Execute getRunHookOutput request + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 run hook output -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public File execute() throws ApiException { + ApiResponse localVarResp = getRunHookOutputWithHttpInfo(repository, runId, hookRunId); + return localVarResp.getData(); + } + + /** + * Execute getRunHookOutput request with HTTP info returned + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 run hook output -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getRunHookOutputWithHttpInfo(repository, runId, hookRunId); + } + + /** + * Execute getRunHookOutput request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 run hook output -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getRunHookOutputAsync(repository, runId, hookRunId, _callback); + } + } + + /** + * get run hook output + * + * @param repository (required) + * @param runId (required) + * @param hookRunId (required) + * @return APIgetRunHookOutputRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 run hook output -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetRunHookOutputRequest getRunHookOutput(String repository, String runId, String hookRunId) { + return new APIgetRunHookOutputRequest(repository, runId, hookRunId); + } + private okhttp3.Call listRepositoryRunsCall(String repository, String after, Integer amount, String branch, String commit, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/actions/runs" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (branch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("branch", branch)); + } + + if (commit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("commit", commit)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listRepositoryRunsValidateBeforeCall(String repository, String after, Integer amount, String branch, String commit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling listRepositoryRuns(Async)"); + } + + return listRepositoryRunsCall(repository, after, amount, branch, commit, _callback); + + } + + + private ApiResponse listRepositoryRunsWithHttpInfo(String repository, String after, Integer amount, String branch, String commit) throws ApiException { + okhttp3.Call localVarCall = listRepositoryRunsValidateBeforeCall(repository, after, amount, branch, commit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listRepositoryRunsAsync(String repository, String after, Integer amount, String branch, String commit, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listRepositoryRunsValidateBeforeCall(repository, after, amount, branch, commit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistRepositoryRunsRequest { + private final String repository; + private String after; + private Integer amount; + private String branch; + private String commit; + + private APIlistRepositoryRunsRequest(String repository) { + this.repository = repository; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistRepositoryRunsRequest + */ + public APIlistRepositoryRunsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistRepositoryRunsRequest + */ + public APIlistRepositoryRunsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set branch + * @param branch (optional) + * @return APIlistRepositoryRunsRequest + */ + public APIlistRepositoryRunsRequest branch(String branch) { + this.branch = branch; + return this; + } + + /** + * Set commit + * @param commit (optional) + * @return APIlistRepositoryRunsRequest + */ + public APIlistRepositoryRunsRequest commit(String commit) { + this.commit = commit; + return this; + } + + /** + * Build call for listRepositoryRuns + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list action runs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listRepositoryRunsCall(repository, after, amount, branch, commit, _callback); + } + + /** + * Execute listRepositoryRuns request + * @return ActionRunList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list action runs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ActionRunList execute() throws ApiException { + ApiResponse localVarResp = listRepositoryRunsWithHttpInfo(repository, after, amount, branch, commit); + return localVarResp.getData(); + } + + /** + * Execute listRepositoryRuns request with HTTP info returned + * @return ApiResponse<ActionRunList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list action runs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listRepositoryRunsWithHttpInfo(repository, after, amount, branch, commit); + } + + /** + * Execute listRepositoryRuns request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list action runs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listRepositoryRunsAsync(repository, after, amount, branch, commit, _callback); + } + } + + /** + * list runs + * + * @param repository (required) + * @return APIlistRepositoryRunsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list action runs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistRepositoryRunsRequest listRepositoryRuns(String repository) { + return new APIlistRepositoryRunsRequest(repository); + } + private okhttp3.Call listRunHooksCall(String repository, String runId, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/actions/runs/{run_id}/hooks" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "run_id" + "}", localVarApiClient.escapeString(runId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listRunHooksValidateBeforeCall(String repository, String runId, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling listRunHooks(Async)"); + } + + // verify the required parameter 'runId' is set + if (runId == null) { + throw new ApiException("Missing the required parameter 'runId' when calling listRunHooks(Async)"); + } + + return listRunHooksCall(repository, runId, after, amount, _callback); + + } + + + private ApiResponse listRunHooksWithHttpInfo(String repository, String runId, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listRunHooksValidateBeforeCall(repository, runId, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listRunHooksAsync(String repository, String runId, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listRunHooksValidateBeforeCall(repository, runId, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistRunHooksRequest { + private final String repository; + private final String runId; + private String after; + private Integer amount; + + private APIlistRunHooksRequest(String repository, String runId) { + this.repository = repository; + this.runId = runId; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistRunHooksRequest + */ + public APIlistRunHooksRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistRunHooksRequest + */ + public APIlistRunHooksRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listRunHooks + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list specific run hooks -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listRunHooksCall(repository, runId, after, amount, _callback); + } + + /** + * Execute listRunHooks request + * @return HookRunList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list specific run hooks -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public HookRunList execute() throws ApiException { + ApiResponse localVarResp = listRunHooksWithHttpInfo(repository, runId, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listRunHooks request with HTTP info returned + * @return ApiResponse<HookRunList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list specific run hooks -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listRunHooksWithHttpInfo(repository, runId, after, amount); + } + + /** + * Execute listRunHooks request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list specific run hooks -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listRunHooksAsync(repository, runId, after, amount, _callback); + } + } + + /** + * list run hooks + * + * @param repository (required) + * @param runId (required) + * @return APIlistRunHooksRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 list specific run hooks -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistRunHooksRequest listRunHooks(String repository, String runId) { + return new APIlistRunHooksRequest(repository, runId); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiCallback.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiCallback.java new file mode 100644 index 00000000000..03975e4115a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java new file mode 100644 index 00000000000..1b0697d86e3 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java @@ -0,0 +1,1573 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.lakefs.clients.sdk.auth.Authentication; +import io.lakefs.clients.sdk.auth.HttpBasicAuth; +import io.lakefs.clients.sdk.auth.HttpBearerAuth; +import io.lakefs.clients.sdk.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "/api/v1"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "/api/v1", + "lakeFS server endpoint", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basic_auth", new HttpBasicAuth()); + authentications.put("jwt_token", new HttpBearerAuth("bearer")); + authentications.put("cookie_auth", new ApiKeyAuth("cookie", "internal_auth_session")); + authentications.put("oidc_auth", new ApiKeyAuth("cookie", "oidc_auth_session")); + authentications.put("saml_auth", new ApiKeyAuth("cookie", "saml_auth_session")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basic_auth", new HttpBasicAuth()); + authentications.put("jwt_token", new HttpBearerAuth("bearer")); + authentications.put("cookie_auth", new ApiKeyAuth("cookie", "internal_auth_session")); + authentications.put("oidc_auth", new ApiKeyAuth("cookie", "oidc_auth_session")); + authentications.put("saml_auth", new ApiKeyAuth("cookie", "saml_auth_session")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("lakefs-java-sdk/0.1.0-SNAPSHOT-v1"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g /api/v1 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.lakefs.clients.sdk.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.lakefs.clients.sdk.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.lakefs.clients.sdk.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.lakefs.clients.sdk.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link io.lakefs.clients.sdk.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws io.lakefs.clients.sdk.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws io.lakefs.clients.sdk.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws io.lakefs.clients.sdk.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws io.lakefs.clients.sdk.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws io.lakefs.clients.sdk.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws io.lakefs.clients.sdk.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws io.lakefs.clients.sdk.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws io.lakefs.clients.sdk.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws io.lakefs.clients.sdk.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws io.lakefs.clients.sdk.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java new file mode 100644 index 00000000000..d167851ab6a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java @@ -0,0 +1,165 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiResponse.java new file mode 100644 index 00000000000..27f9c8c2c0a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/AuthApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/AuthApi.java new file mode 100644 index 00000000000..b4c02337e9a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/AuthApi.java @@ -0,0 +1,5637 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.ACL; +import io.lakefs.clients.sdk.model.AuthenticationToken; +import io.lakefs.clients.sdk.model.Credentials; +import io.lakefs.clients.sdk.model.CredentialsList; +import io.lakefs.clients.sdk.model.CredentialsWithSecret; +import io.lakefs.clients.sdk.model.CurrentUser; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ErrorNoACL; +import io.lakefs.clients.sdk.model.Group; +import io.lakefs.clients.sdk.model.GroupCreation; +import io.lakefs.clients.sdk.model.GroupList; +import io.lakefs.clients.sdk.model.LoginInformation; +import io.lakefs.clients.sdk.model.Policy; +import io.lakefs.clients.sdk.model.PolicyList; +import io.lakefs.clients.sdk.model.User; +import io.lakefs.clients.sdk.model.UserCreation; +import io.lakefs.clients.sdk.model.UserList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuthApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AuthApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuthApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call addGroupMembershipCall(String groupId, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/members/{userId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())) + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addGroupMembershipValidateBeforeCall(String groupId, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling addGroupMembership(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling addGroupMembership(Async)"); + } + + return addGroupMembershipCall(groupId, userId, _callback); + + } + + + private ApiResponse addGroupMembershipWithHttpInfo(String groupId, String userId) throws ApiException { + okhttp3.Call localVarCall = addGroupMembershipValidateBeforeCall(groupId, userId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call addGroupMembershipAsync(String groupId, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addGroupMembershipValidateBeforeCall(groupId, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIaddGroupMembershipRequest { + private final String groupId; + private final String userId; + + private APIaddGroupMembershipRequest(String groupId, String userId) { + this.groupId = groupId; + this.userId = userId; + } + + /** + * Build call for addGroupMembership + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 membership added successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return addGroupMembershipCall(groupId, userId, _callback); + } + + /** + * Execute addGroupMembership request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 membership added successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + addGroupMembershipWithHttpInfo(groupId, userId); + } + + /** + * Execute addGroupMembership request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 membership added successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return addGroupMembershipWithHttpInfo(groupId, userId); + } + + /** + * Execute addGroupMembership request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 membership added successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return addGroupMembershipAsync(groupId, userId, _callback); + } + } + + /** + * add group membership + * + * @param groupId (required) + * @param userId (required) + * @return APIaddGroupMembershipRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 membership added successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIaddGroupMembershipRequest addGroupMembership(String groupId, String userId) { + return new APIaddGroupMembershipRequest(groupId, userId); + } + private okhttp3.Call attachPolicyToGroupCall(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/policies/{policyId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())) + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call attachPolicyToGroupValidateBeforeCall(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling attachPolicyToGroup(Async)"); + } + + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling attachPolicyToGroup(Async)"); + } + + return attachPolicyToGroupCall(groupId, policyId, _callback); + + } + + + private ApiResponse attachPolicyToGroupWithHttpInfo(String groupId, String policyId) throws ApiException { + okhttp3.Call localVarCall = attachPolicyToGroupValidateBeforeCall(groupId, policyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call attachPolicyToGroupAsync(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = attachPolicyToGroupValidateBeforeCall(groupId, policyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIattachPolicyToGroupRequest { + private final String groupId; + private final String policyId; + + private APIattachPolicyToGroupRequest(String groupId, String policyId) { + this.groupId = groupId; + this.policyId = policyId; + } + + /** + * Build call for attachPolicyToGroup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return attachPolicyToGroupCall(groupId, policyId, _callback); + } + + /** + * Execute attachPolicyToGroup request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + attachPolicyToGroupWithHttpInfo(groupId, policyId); + } + + /** + * Execute attachPolicyToGroup request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return attachPolicyToGroupWithHttpInfo(groupId, policyId); + } + + /** + * Execute attachPolicyToGroup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return attachPolicyToGroupAsync(groupId, policyId, _callback); + } + } + + /** + * attach policy to group + * + * @param groupId (required) + * @param policyId (required) + * @return APIattachPolicyToGroupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIattachPolicyToGroupRequest attachPolicyToGroup(String groupId, String policyId) { + return new APIattachPolicyToGroupRequest(groupId, policyId); + } + private okhttp3.Call attachPolicyToUserCall(String userId, String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/policies/{policyId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())) + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call attachPolicyToUserValidateBeforeCall(String userId, String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling attachPolicyToUser(Async)"); + } + + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling attachPolicyToUser(Async)"); + } + + return attachPolicyToUserCall(userId, policyId, _callback); + + } + + + private ApiResponse attachPolicyToUserWithHttpInfo(String userId, String policyId) throws ApiException { + okhttp3.Call localVarCall = attachPolicyToUserValidateBeforeCall(userId, policyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call attachPolicyToUserAsync(String userId, String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = attachPolicyToUserValidateBeforeCall(userId, policyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIattachPolicyToUserRequest { + private final String userId; + private final String policyId; + + private APIattachPolicyToUserRequest(String userId, String policyId) { + this.userId = userId; + this.policyId = policyId; + } + + /** + * Build call for attachPolicyToUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return attachPolicyToUserCall(userId, policyId, _callback); + } + + /** + * Execute attachPolicyToUser request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + attachPolicyToUserWithHttpInfo(userId, policyId); + } + + /** + * Execute attachPolicyToUser request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return attachPolicyToUserWithHttpInfo(userId, policyId); + } + + /** + * Execute attachPolicyToUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return attachPolicyToUserAsync(userId, policyId, _callback); + } + } + + /** + * attach policy to user + * + * @param userId (required) + * @param policyId (required) + * @return APIattachPolicyToUserRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 policy attached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIattachPolicyToUserRequest attachPolicyToUser(String userId, String policyId) { + return new APIattachPolicyToUserRequest(userId, policyId); + } + private okhttp3.Call createCredentialsCall(String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/credentials" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCredentialsValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling createCredentials(Async)"); + } + + return createCredentialsCall(userId, _callback); + + } + + + private ApiResponse createCredentialsWithHttpInfo(String userId) throws ApiException { + okhttp3.Call localVarCall = createCredentialsValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createCredentialsAsync(String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createCredentialsValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateCredentialsRequest { + private final String userId; + + private APIcreateCredentialsRequest(String userId) { + this.userId = userId; + } + + /** + * Build call for createCredentials + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createCredentialsCall(userId, _callback); + } + + /** + * Execute createCredentials request + * @return CredentialsWithSecret + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public CredentialsWithSecret execute() throws ApiException { + ApiResponse localVarResp = createCredentialsWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * Execute createCredentials request with HTTP info returned + * @return ApiResponse<CredentialsWithSecret> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createCredentialsWithHttpInfo(userId); + } + + /** + * Execute createCredentials request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createCredentialsAsync(userId, _callback); + } + } + + /** + * create credentials + * + * @param userId (required) + * @return APIcreateCredentialsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIcreateCredentialsRequest createCredentials(String userId) { + return new APIcreateCredentialsRequest(userId); + } + private okhttp3.Call createGroupCall(GroupCreation groupCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = groupCreation; + + // create path and map variables + String localVarPath = "/auth/groups"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createGroupValidateBeforeCall(GroupCreation groupCreation, final ApiCallback _callback) throws ApiException { + return createGroupCall(groupCreation, _callback); + + } + + + private ApiResponse createGroupWithHttpInfo(GroupCreation groupCreation) throws ApiException { + okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createGroupAsync(GroupCreation groupCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateGroupRequest { + private GroupCreation groupCreation; + + private APIcreateGroupRequest() { + } + + /** + * Set groupCreation + * @param groupCreation (optional) + * @return APIcreateGroupRequest + */ + public APIcreateGroupRequest groupCreation(GroupCreation groupCreation) { + this.groupCreation = groupCreation; + return this; + } + + /** + * Build call for createGroup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createGroupCall(groupCreation, _callback); + } + + /** + * Execute createGroup request + * @return Group + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Group execute() throws ApiException { + ApiResponse localVarResp = createGroupWithHttpInfo(groupCreation); + return localVarResp.getData(); + } + + /** + * Execute createGroup request with HTTP info returned + * @return ApiResponse<Group> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createGroupWithHttpInfo(groupCreation); + } + + /** + * Execute createGroup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createGroupAsync(groupCreation, _callback); + } + } + + /** + * create group + * + * @return APIcreateGroupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIcreateGroupRequest createGroup() { + return new APIcreateGroupRequest(); + } + private okhttp3.Call createPolicyCall(Policy policy, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = policy; + + // create path and map variables + String localVarPath = "/auth/policies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPolicyValidateBeforeCall(Policy policy, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'policy' is set + if (policy == null) { + throw new ApiException("Missing the required parameter 'policy' when calling createPolicy(Async)"); + } + + return createPolicyCall(policy, _callback); + + } + + + private ApiResponse createPolicyWithHttpInfo(Policy policy) throws ApiException { + okhttp3.Call localVarCall = createPolicyValidateBeforeCall(policy, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createPolicyAsync(Policy policy, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPolicyValidateBeforeCall(policy, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreatePolicyRequest { + private final Policy policy; + + private APIcreatePolicyRequest(Policy policy) { + this.policy = policy; + } + + /** + * Build call for createPolicy + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 policy -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createPolicyCall(policy, _callback); + } + + /** + * Execute createPolicy request + * @return Policy + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 policy -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public Policy execute() throws ApiException { + ApiResponse localVarResp = createPolicyWithHttpInfo(policy); + return localVarResp.getData(); + } + + /** + * Execute createPolicy request with HTTP info returned + * @return ApiResponse<Policy> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 policy -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createPolicyWithHttpInfo(policy); + } + + /** + * Execute createPolicy request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 policy -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createPolicyAsync(policy, _callback); + } + } + + /** + * create policy + * + * @param policy (required) + * @return APIcreatePolicyRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 policy -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreatePolicyRequest createPolicy(Policy policy) { + return new APIcreatePolicyRequest(policy); + } + private okhttp3.Call createUserCall(UserCreation userCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userCreation; + + // create path and map variables + String localVarPath = "/auth/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUserValidateBeforeCall(UserCreation userCreation, final ApiCallback _callback) throws ApiException { + return createUserCall(userCreation, _callback); + + } + + + private ApiResponse createUserWithHttpInfo(UserCreation userCreation) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(userCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createUserAsync(UserCreation userCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUserValidateBeforeCall(userCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateUserRequest { + private UserCreation userCreation; + + private APIcreateUserRequest() { + } + + /** + * Set userCreation + * @param userCreation (optional) + * @return APIcreateUserRequest + */ + public APIcreateUserRequest userCreation(UserCreation userCreation) { + this.userCreation = userCreation; + return this; + } + + /** + * Build call for createUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 user -
400 validation error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createUserCall(userCreation, _callback); + } + + /** + * Execute createUser request + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 user -
400 validation error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public User execute() throws ApiException { + ApiResponse localVarResp = createUserWithHttpInfo(userCreation); + return localVarResp.getData(); + } + + /** + * Execute createUser request with HTTP info returned + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 user -
400 validation error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createUserWithHttpInfo(userCreation); + } + + /** + * Execute createUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 user -
400 validation error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createUserAsync(userCreation, _callback); + } + } + + /** + * create user + * + * @return APIcreateUserRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 user -
400 validation error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreateUserRequest createUser() { + return new APIcreateUserRequest(); + } + private okhttp3.Call deleteCredentialsCall(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/credentials/{accessKeyId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())) + .replace("{" + "accessKeyId" + "}", localVarApiClient.escapeString(accessKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCredentialsValidateBeforeCall(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteCredentials(Async)"); + } + + // verify the required parameter 'accessKeyId' is set + if (accessKeyId == null) { + throw new ApiException("Missing the required parameter 'accessKeyId' when calling deleteCredentials(Async)"); + } + + return deleteCredentialsCall(userId, accessKeyId, _callback); + + } + + + private ApiResponse deleteCredentialsWithHttpInfo(String userId, String accessKeyId) throws ApiException { + okhttp3.Call localVarCall = deleteCredentialsValidateBeforeCall(userId, accessKeyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteCredentialsAsync(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCredentialsValidateBeforeCall(userId, accessKeyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteCredentialsRequest { + private final String userId; + private final String accessKeyId; + + private APIdeleteCredentialsRequest(String userId, String accessKeyId) { + this.userId = userId; + this.accessKeyId = accessKeyId; + } + + /** + * Build call for deleteCredentials + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 credentials deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteCredentialsCall(userId, accessKeyId, _callback); + } + + /** + * Execute deleteCredentials request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 credentials deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteCredentialsWithHttpInfo(userId, accessKeyId); + } + + /** + * Execute deleteCredentials request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 credentials deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteCredentialsWithHttpInfo(userId, accessKeyId); + } + + /** + * Execute deleteCredentials request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 credentials deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteCredentialsAsync(userId, accessKeyId, _callback); + } + } + + /** + * delete credentials + * + * @param userId (required) + * @param accessKeyId (required) + * @return APIdeleteCredentialsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 credentials deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteCredentialsRequest deleteCredentials(String userId, String accessKeyId) { + return new APIdeleteCredentialsRequest(userId, accessKeyId); + } + private okhttp3.Call deleteGroupCall(String groupId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteGroupValidateBeforeCall(String groupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling deleteGroup(Async)"); + } + + return deleteGroupCall(groupId, _callback); + + } + + + private ApiResponse deleteGroupWithHttpInfo(String groupId) throws ApiException { + okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteGroupAsync(String groupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteGroupRequest { + private final String groupId; + + private APIdeleteGroupRequest(String groupId) { + this.groupId = groupId; + } + + /** + * Build call for deleteGroup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteGroupCall(groupId, _callback); + } + + /** + * Execute deleteGroup request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteGroupWithHttpInfo(groupId); + } + + /** + * Execute deleteGroup request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteGroupWithHttpInfo(groupId); + } + + /** + * Execute deleteGroup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteGroupAsync(groupId, _callback); + } + } + + /** + * delete group + * + * @param groupId (required) + * @return APIdeleteGroupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteGroupRequest deleteGroup(String groupId) { + return new APIdeleteGroupRequest(groupId); + } + private okhttp3.Call deleteGroupMembershipCall(String groupId, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/members/{userId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())) + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteGroupMembershipValidateBeforeCall(String groupId, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling deleteGroupMembership(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteGroupMembership(Async)"); + } + + return deleteGroupMembershipCall(groupId, userId, _callback); + + } + + + private ApiResponse deleteGroupMembershipWithHttpInfo(String groupId, String userId) throws ApiException { + okhttp3.Call localVarCall = deleteGroupMembershipValidateBeforeCall(groupId, userId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteGroupMembershipAsync(String groupId, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteGroupMembershipValidateBeforeCall(groupId, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteGroupMembershipRequest { + private final String groupId; + private final String userId; + + private APIdeleteGroupMembershipRequest(String groupId, String userId) { + this.groupId = groupId; + this.userId = userId; + } + + /** + * Build call for deleteGroupMembership + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 membership deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteGroupMembershipCall(groupId, userId, _callback); + } + + /** + * Execute deleteGroupMembership request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 membership deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteGroupMembershipWithHttpInfo(groupId, userId); + } + + /** + * Execute deleteGroupMembership request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 membership deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteGroupMembershipWithHttpInfo(groupId, userId); + } + + /** + * Execute deleteGroupMembership request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 membership deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteGroupMembershipAsync(groupId, userId, _callback); + } + } + + /** + * delete group membership + * + * @param groupId (required) + * @param userId (required) + * @return APIdeleteGroupMembershipRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 membership deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteGroupMembershipRequest deleteGroupMembership(String groupId, String userId) { + return new APIdeleteGroupMembershipRequest(groupId, userId); + } + private okhttp3.Call deletePolicyCall(String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/policies/{policyId}" + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePolicyValidateBeforeCall(String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling deletePolicy(Async)"); + } + + return deletePolicyCall(policyId, _callback); + + } + + + private ApiResponse deletePolicyWithHttpInfo(String policyId) throws ApiException { + okhttp3.Call localVarCall = deletePolicyValidateBeforeCall(policyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deletePolicyAsync(String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePolicyValidateBeforeCall(policyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeletePolicyRequest { + private final String policyId; + + private APIdeletePolicyRequest(String policyId) { + this.policyId = policyId; + } + + /** + * Build call for deletePolicy + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deletePolicyCall(policyId, _callback); + } + + /** + * Execute deletePolicy request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deletePolicyWithHttpInfo(policyId); + } + + /** + * Execute deletePolicy request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deletePolicyWithHttpInfo(policyId); + } + + /** + * Execute deletePolicy request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deletePolicyAsync(policyId, _callback); + } + } + + /** + * delete policy + * + * @param policyId (required) + * @return APIdeletePolicyRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeletePolicyRequest deletePolicy(String policyId) { + return new APIdeletePolicyRequest(policyId); + } + private okhttp3.Call deleteUserCall(String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteUserValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteUser(Async)"); + } + + return deleteUserCall(userId, _callback); + + } + + + private ApiResponse deleteUserWithHttpInfo(String userId) throws ApiException { + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(userId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteUserAsync(String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteUserRequest { + private final String userId; + + private APIdeleteUserRequest(String userId) { + this.userId = userId; + } + + /** + * Build call for deleteUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 user deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteUserCall(userId, _callback); + } + + /** + * Execute deleteUser request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 user deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteUserWithHttpInfo(userId); + } + + /** + * Execute deleteUser request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 user deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteUserWithHttpInfo(userId); + } + + /** + * Execute deleteUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 user deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteUserAsync(userId, _callback); + } + } + + /** + * delete user + * + * @param userId (required) + * @return APIdeleteUserRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 user deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteUserRequest deleteUser(String userId) { + return new APIdeleteUserRequest(userId); + } + private okhttp3.Call detachPolicyFromGroupCall(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/policies/{policyId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())) + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call detachPolicyFromGroupValidateBeforeCall(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling detachPolicyFromGroup(Async)"); + } + + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling detachPolicyFromGroup(Async)"); + } + + return detachPolicyFromGroupCall(groupId, policyId, _callback); + + } + + + private ApiResponse detachPolicyFromGroupWithHttpInfo(String groupId, String policyId) throws ApiException { + okhttp3.Call localVarCall = detachPolicyFromGroupValidateBeforeCall(groupId, policyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call detachPolicyFromGroupAsync(String groupId, String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = detachPolicyFromGroupValidateBeforeCall(groupId, policyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdetachPolicyFromGroupRequest { + private final String groupId; + private final String policyId; + + private APIdetachPolicyFromGroupRequest(String groupId, String policyId) { + this.groupId = groupId; + this.policyId = policyId; + } + + /** + * Build call for detachPolicyFromGroup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return detachPolicyFromGroupCall(groupId, policyId, _callback); + } + + /** + * Execute detachPolicyFromGroup request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + detachPolicyFromGroupWithHttpInfo(groupId, policyId); + } + + /** + * Execute detachPolicyFromGroup request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return detachPolicyFromGroupWithHttpInfo(groupId, policyId); + } + + /** + * Execute detachPolicyFromGroup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return detachPolicyFromGroupAsync(groupId, policyId, _callback); + } + } + + /** + * detach policy from group + * + * @param groupId (required) + * @param policyId (required) + * @return APIdetachPolicyFromGroupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdetachPolicyFromGroupRequest detachPolicyFromGroup(String groupId, String policyId) { + return new APIdetachPolicyFromGroupRequest(groupId, policyId); + } + private okhttp3.Call detachPolicyFromUserCall(String userId, String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/policies/{policyId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())) + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call detachPolicyFromUserValidateBeforeCall(String userId, String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling detachPolicyFromUser(Async)"); + } + + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling detachPolicyFromUser(Async)"); + } + + return detachPolicyFromUserCall(userId, policyId, _callback); + + } + + + private ApiResponse detachPolicyFromUserWithHttpInfo(String userId, String policyId) throws ApiException { + okhttp3.Call localVarCall = detachPolicyFromUserValidateBeforeCall(userId, policyId, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call detachPolicyFromUserAsync(String userId, String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = detachPolicyFromUserValidateBeforeCall(userId, policyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdetachPolicyFromUserRequest { + private final String userId; + private final String policyId; + + private APIdetachPolicyFromUserRequest(String userId, String policyId) { + this.userId = userId; + this.policyId = policyId; + } + + /** + * Build call for detachPolicyFromUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return detachPolicyFromUserCall(userId, policyId, _callback); + } + + /** + * Execute detachPolicyFromUser request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + detachPolicyFromUserWithHttpInfo(userId, policyId); + } + + /** + * Execute detachPolicyFromUser request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return detachPolicyFromUserWithHttpInfo(userId, policyId); + } + + /** + * Execute detachPolicyFromUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return detachPolicyFromUserAsync(userId, policyId, _callback); + } + } + + /** + * detach policy from user + * + * @param userId (required) + * @param policyId (required) + * @return APIdetachPolicyFromUserRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 policy detached successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdetachPolicyFromUserRequest detachPolicyFromUser(String userId, String policyId) { + return new APIdetachPolicyFromUserRequest(userId, policyId); + } + private okhttp3.Call getCredentialsCall(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/credentials/{accessKeyId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())) + .replace("{" + "accessKeyId" + "}", localVarApiClient.escapeString(accessKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialsValidateBeforeCall(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getCredentials(Async)"); + } + + // verify the required parameter 'accessKeyId' is set + if (accessKeyId == null) { + throw new ApiException("Missing the required parameter 'accessKeyId' when calling getCredentials(Async)"); + } + + return getCredentialsCall(userId, accessKeyId, _callback); + + } + + + private ApiResponse getCredentialsWithHttpInfo(String userId, String accessKeyId) throws ApiException { + okhttp3.Call localVarCall = getCredentialsValidateBeforeCall(userId, accessKeyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getCredentialsAsync(String userId, String accessKeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCredentialsValidateBeforeCall(userId, accessKeyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetCredentialsRequest { + private final String userId; + private final String accessKeyId; + + private APIgetCredentialsRequest(String userId, String accessKeyId) { + this.userId = userId; + this.accessKeyId = accessKeyId; + } + + /** + * Build call for getCredentials + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getCredentialsCall(userId, accessKeyId, _callback); + } + + /** + * Execute getCredentials request + * @return Credentials + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Credentials execute() throws ApiException { + ApiResponse localVarResp = getCredentialsWithHttpInfo(userId, accessKeyId); + return localVarResp.getData(); + } + + /** + * Execute getCredentials request with HTTP info returned + * @return ApiResponse<Credentials> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getCredentialsWithHttpInfo(userId, accessKeyId); + } + + /** + * Execute getCredentials request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getCredentialsAsync(userId, accessKeyId, _callback); + } + } + + /** + * get credentials + * + * @param userId (required) + * @param accessKeyId (required) + * @return APIgetCredentialsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credentials -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetCredentialsRequest getCredentials(String userId, String accessKeyId) { + return new APIgetCredentialsRequest(userId, accessKeyId); + } + private okhttp3.Call getCurrentUserCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCurrentUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getCurrentUserCall(_callback); + + } + + + private ApiResponse getCurrentUserWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getCurrentUserValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getCurrentUserAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCurrentUserValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetCurrentUserRequest { + + private APIgetCurrentUserRequest() { + } + + /** + * Build call for getCurrentUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 user -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getCurrentUserCall(_callback); + } + + /** + * Execute getCurrentUser request + * @return CurrentUser + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 user -
+ */ + public CurrentUser execute() throws ApiException { + ApiResponse localVarResp = getCurrentUserWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getCurrentUser request with HTTP info returned + * @return ApiResponse<CurrentUser> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 user -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getCurrentUserWithHttpInfo(); + } + + /** + * Execute getCurrentUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 user -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getCurrentUserAsync(_callback); + } + } + + /** + * get current user + * + * @return APIgetCurrentUserRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 user -
+ */ + public APIgetCurrentUserRequest getCurrentUser() { + return new APIgetCurrentUserRequest(); + } + private okhttp3.Call getGroupCall(String groupId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGroupValidateBeforeCall(String groupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling getGroup(Async)"); + } + + return getGroupCall(groupId, _callback); + + } + + + private ApiResponse getGroupWithHttpInfo(String groupId) throws ApiException { + okhttp3.Call localVarCall = getGroupValidateBeforeCall(groupId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getGroupAsync(String groupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGroupValidateBeforeCall(groupId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetGroupRequest { + private final String groupId; + + private APIgetGroupRequest(String groupId) { + this.groupId = groupId; + } + + /** + * Build call for getGroup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getGroupCall(groupId, _callback); + } + + /** + * Execute getGroup request + * @return Group + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Group execute() throws ApiException { + ApiResponse localVarResp = getGroupWithHttpInfo(groupId); + return localVarResp.getData(); + } + + /** + * Execute getGroup request with HTTP info returned + * @return ApiResponse<Group> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getGroupWithHttpInfo(groupId); + } + + /** + * Execute getGroup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getGroupAsync(groupId, _callback); + } + } + + /** + * get group + * + * @param groupId (required) + * @return APIgetGroupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetGroupRequest getGroup(String groupId) { + return new APIgetGroupRequest(groupId); + } + private okhttp3.Call getGroupACLCall(String groupId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/acl" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGroupACLValidateBeforeCall(String groupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling getGroupACL(Async)"); + } + + return getGroupACLCall(groupId, _callback); + + } + + + private ApiResponse getGroupACLWithHttpInfo(String groupId) throws ApiException { + okhttp3.Call localVarCall = getGroupACLValidateBeforeCall(groupId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getGroupACLAsync(String groupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGroupACLValidateBeforeCall(groupId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetGroupACLRequest { + private final String groupId; + + private APIgetGroupACLRequest(String groupId) { + this.groupId = groupId; + } + + /** + * Build call for getGroupACL + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 ACL of group -
401 Unauthorized -
404 Group not found, or group found but has no ACL -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getGroupACLCall(groupId, _callback); + } + + /** + * Execute getGroupACL request + * @return ACL + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 ACL of group -
401 Unauthorized -
404 Group not found, or group found but has no ACL -
0 Internal Server Error -
+ */ + public ACL execute() throws ApiException { + ApiResponse localVarResp = getGroupACLWithHttpInfo(groupId); + return localVarResp.getData(); + } + + /** + * Execute getGroupACL request with HTTP info returned + * @return ApiResponse<ACL> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 ACL of group -
401 Unauthorized -
404 Group not found, or group found but has no ACL -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getGroupACLWithHttpInfo(groupId); + } + + /** + * Execute getGroupACL request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 ACL of group -
401 Unauthorized -
404 Group not found, or group found but has no ACL -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getGroupACLAsync(groupId, _callback); + } + } + + /** + * get ACL of group + * + * @param groupId (required) + * @return APIgetGroupACLRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 ACL of group -
401 Unauthorized -
404 Group not found, or group found but has no ACL -
0 Internal Server Error -
+ */ + public APIgetGroupACLRequest getGroupACL(String groupId) { + return new APIgetGroupACLRequest(groupId); + } + private okhttp3.Call getPolicyCall(String policyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/policies/{policyId}" + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPolicyValidateBeforeCall(String policyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling getPolicy(Async)"); + } + + return getPolicyCall(policyId, _callback); + + } + + + private ApiResponse getPolicyWithHttpInfo(String policyId) throws ApiException { + okhttp3.Call localVarCall = getPolicyValidateBeforeCall(policyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getPolicyAsync(String policyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPolicyValidateBeforeCall(policyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetPolicyRequest { + private final String policyId; + + private APIgetPolicyRequest(String policyId) { + this.policyId = policyId; + } + + /** + * Build call for getPolicy + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getPolicyCall(policyId, _callback); + } + + /** + * Execute getPolicy request + * @return Policy + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Policy execute() throws ApiException { + ApiResponse localVarResp = getPolicyWithHttpInfo(policyId); + return localVarResp.getData(); + } + + /** + * Execute getPolicy request with HTTP info returned + * @return ApiResponse<Policy> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPolicyWithHttpInfo(policyId); + } + + /** + * Execute getPolicy request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPolicyAsync(policyId, _callback); + } + } + + /** + * get policy + * + * @param policyId (required) + * @return APIgetPolicyRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetPolicyRequest getPolicy(String policyId) { + return new APIgetPolicyRequest(policyId); + } + private okhttp3.Call getUserCall(String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getUser(Async)"); + } + + return getUserCall(userId, _callback); + + } + + + private ApiResponse getUserWithHttpInfo(String userId) throws ApiException { + okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getUserAsync(String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetUserRequest { + private final String userId; + + private APIgetUserRequest(String userId) { + this.userId = userId; + } + + /** + * Build call for getUser + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getUserCall(userId, _callback); + } + + /** + * Execute getUser request + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public User execute() throws ApiException { + ApiResponse localVarResp = getUserWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * Execute getUser request with HTTP info returned + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getUserWithHttpInfo(userId); + } + + /** + * Execute getUser request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getUserAsync(userId, _callback); + } + } + + /** + * get user + * + * @param userId (required) + * @return APIgetUserRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetUserRequest getUser(String userId) { + return new APIgetUserRequest(userId); + } + private okhttp3.Call listGroupMembersCall(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/members" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listGroupMembersValidateBeforeCall(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling listGroupMembers(Async)"); + } + + return listGroupMembersCall(groupId, prefix, after, amount, _callback); + + } + + + private ApiResponse listGroupMembersWithHttpInfo(String groupId, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listGroupMembersValidateBeforeCall(groupId, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listGroupMembersAsync(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listGroupMembersValidateBeforeCall(groupId, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistGroupMembersRequest { + private final String groupId; + private String prefix; + private String after; + private Integer amount; + + private APIlistGroupMembersRequest(String groupId) { + this.groupId = groupId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistGroupMembersRequest + */ + public APIlistGroupMembersRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistGroupMembersRequest + */ + public APIlistGroupMembersRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistGroupMembersRequest + */ + public APIlistGroupMembersRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listGroupMembers + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group member list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listGroupMembersCall(groupId, prefix, after, amount, _callback); + } + + /** + * Execute listGroupMembers request + * @return UserList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group member list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public UserList execute() throws ApiException { + ApiResponse localVarResp = listGroupMembersWithHttpInfo(groupId, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listGroupMembers request with HTTP info returned + * @return ApiResponse<UserList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group member list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listGroupMembersWithHttpInfo(groupId, prefix, after, amount); + } + + /** + * Execute listGroupMembers request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group member list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listGroupMembersAsync(groupId, prefix, after, amount, _callback); + } + } + + /** + * list group members + * + * @param groupId (required) + * @return APIlistGroupMembersRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group member list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIlistGroupMembersRequest listGroupMembers(String groupId) { + return new APIlistGroupMembersRequest(groupId); + } + private okhttp3.Call listGroupPoliciesCall(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/policies" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listGroupPoliciesValidateBeforeCall(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling listGroupPolicies(Async)"); + } + + return listGroupPoliciesCall(groupId, prefix, after, amount, _callback); + + } + + + private ApiResponse listGroupPoliciesWithHttpInfo(String groupId, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listGroupPoliciesValidateBeforeCall(groupId, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listGroupPoliciesAsync(String groupId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listGroupPoliciesValidateBeforeCall(groupId, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistGroupPoliciesRequest { + private final String groupId; + private String prefix; + private String after; + private Integer amount; + + private APIlistGroupPoliciesRequest(String groupId) { + this.groupId = groupId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistGroupPoliciesRequest + */ + public APIlistGroupPoliciesRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistGroupPoliciesRequest + */ + public APIlistGroupPoliciesRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistGroupPoliciesRequest + */ + public APIlistGroupPoliciesRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listGroupPolicies + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listGroupPoliciesCall(groupId, prefix, after, amount, _callback); + } + + /** + * Execute listGroupPolicies request + * @return PolicyList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public PolicyList execute() throws ApiException { + ApiResponse localVarResp = listGroupPoliciesWithHttpInfo(groupId, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listGroupPolicies request with HTTP info returned + * @return ApiResponse<PolicyList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listGroupPoliciesWithHttpInfo(groupId, prefix, after, amount); + } + + /** + * Execute listGroupPolicies request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listGroupPoliciesAsync(groupId, prefix, after, amount, _callback); + } + } + + /** + * list group policies + * + * @param groupId (required) + * @return APIlistGroupPoliciesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistGroupPoliciesRequest listGroupPolicies(String groupId) { + return new APIlistGroupPoliciesRequest(groupId); + } + private okhttp3.Call listGroupsCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/groups"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listGroupsValidateBeforeCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + return listGroupsCall(prefix, after, amount, _callback); + + } + + + private ApiResponse listGroupsWithHttpInfo(String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listGroupsValidateBeforeCall(prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listGroupsAsync(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listGroupsValidateBeforeCall(prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistGroupsRequest { + private String prefix; + private String after; + private Integer amount; + + private APIlistGroupsRequest() { + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistGroupsRequest + */ + public APIlistGroupsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistGroupsRequest + */ + public APIlistGroupsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistGroupsRequest + */ + public APIlistGroupsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listGroups + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listGroupsCall(prefix, after, amount, _callback); + } + + /** + * Execute listGroups request + * @return GroupList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public GroupList execute() throws ApiException { + ApiResponse localVarResp = listGroupsWithHttpInfo(prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listGroups request with HTTP info returned + * @return ApiResponse<GroupList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listGroupsWithHttpInfo(prefix, after, amount); + } + + /** + * Execute listGroups request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listGroupsAsync(prefix, after, amount, _callback); + } + } + + /** + * list groups + * + * @return APIlistGroupsRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIlistGroupsRequest listGroups() { + return new APIlistGroupsRequest(); + } + private okhttp3.Call listPoliciesCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/policies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPoliciesValidateBeforeCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + return listPoliciesCall(prefix, after, amount, _callback); + + } + + + private ApiResponse listPoliciesWithHttpInfo(String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listPoliciesValidateBeforeCall(prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listPoliciesAsync(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPoliciesValidateBeforeCall(prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistPoliciesRequest { + private String prefix; + private String after; + private Integer amount; + + private APIlistPoliciesRequest() { + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistPoliciesRequest + */ + public APIlistPoliciesRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistPoliciesRequest + */ + public APIlistPoliciesRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistPoliciesRequest + */ + public APIlistPoliciesRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listPolicies + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listPoliciesCall(prefix, after, amount, _callback); + } + + /** + * Execute listPolicies request + * @return PolicyList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public PolicyList execute() throws ApiException { + ApiResponse localVarResp = listPoliciesWithHttpInfo(prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listPolicies request with HTTP info returned + * @return ApiResponse<PolicyList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listPoliciesWithHttpInfo(prefix, after, amount); + } + + /** + * Execute listPolicies request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listPoliciesAsync(prefix, after, amount, _callback); + } + } + + /** + * list policies + * + * @return APIlistPoliciesRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIlistPoliciesRequest listPolicies() { + return new APIlistPoliciesRequest(); + } + private okhttp3.Call listUserCredentialsCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/credentials" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUserCredentialsValidateBeforeCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling listUserCredentials(Async)"); + } + + return listUserCredentialsCall(userId, prefix, after, amount, _callback); + + } + + + private ApiResponse listUserCredentialsWithHttpInfo(String userId, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listUserCredentialsValidateBeforeCall(userId, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUserCredentialsAsync(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listUserCredentialsValidateBeforeCall(userId, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUserCredentialsRequest { + private final String userId; + private String prefix; + private String after; + private Integer amount; + + private APIlistUserCredentialsRequest(String userId) { + this.userId = userId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistUserCredentialsRequest + */ + public APIlistUserCredentialsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistUserCredentialsRequest + */ + public APIlistUserCredentialsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistUserCredentialsRequest + */ + public APIlistUserCredentialsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listUserCredentials + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credential list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUserCredentialsCall(userId, prefix, after, amount, _callback); + } + + /** + * Execute listUserCredentials request + * @return CredentialsList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credential list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public CredentialsList execute() throws ApiException { + ApiResponse localVarResp = listUserCredentialsWithHttpInfo(userId, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listUserCredentials request with HTTP info returned + * @return ApiResponse<CredentialsList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credential list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUserCredentialsWithHttpInfo(userId, prefix, after, amount); + } + + /** + * Execute listUserCredentials request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credential list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listUserCredentialsAsync(userId, prefix, after, amount, _callback); + } + } + + /** + * list user credentials + * + * @param userId (required) + * @return APIlistUserCredentialsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 credential list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistUserCredentialsRequest listUserCredentials(String userId) { + return new APIlistUserCredentialsRequest(userId); + } + private okhttp3.Call listUserGroupsCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/groups" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUserGroupsValidateBeforeCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling listUserGroups(Async)"); + } + + return listUserGroupsCall(userId, prefix, after, amount, _callback); + + } + + + private ApiResponse listUserGroupsWithHttpInfo(String userId, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listUserGroupsValidateBeforeCall(userId, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUserGroupsAsync(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listUserGroupsValidateBeforeCall(userId, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUserGroupsRequest { + private final String userId; + private String prefix; + private String after; + private Integer amount; + + private APIlistUserGroupsRequest(String userId) { + this.userId = userId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistUserGroupsRequest + */ + public APIlistUserGroupsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistUserGroupsRequest + */ + public APIlistUserGroupsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistUserGroupsRequest + */ + public APIlistUserGroupsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listUserGroups + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUserGroupsCall(userId, prefix, after, amount, _callback); + } + + /** + * Execute listUserGroups request + * @return GroupList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public GroupList execute() throws ApiException { + ApiResponse localVarResp = listUserGroupsWithHttpInfo(userId, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listUserGroups request with HTTP info returned + * @return ApiResponse<GroupList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUserGroupsWithHttpInfo(userId, prefix, after, amount); + } + + /** + * Execute listUserGroups request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listUserGroupsAsync(userId, prefix, after, amount, _callback); + } + } + + /** + * list user groups + * + * @param userId (required) + * @return APIlistUserGroupsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 group list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistUserGroupsRequest listUserGroups(String userId) { + return new APIlistUserGroupsRequest(userId); + } + private okhttp3.Call listUserPoliciesCall(String userId, String prefix, String after, Integer amount, Boolean effective, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/policies" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (effective != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("effective", effective)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUserPoliciesValidateBeforeCall(String userId, String prefix, String after, Integer amount, Boolean effective, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling listUserPolicies(Async)"); + } + + return listUserPoliciesCall(userId, prefix, after, amount, effective, _callback); + + } + + + private ApiResponse listUserPoliciesWithHttpInfo(String userId, String prefix, String after, Integer amount, Boolean effective) throws ApiException { + okhttp3.Call localVarCall = listUserPoliciesValidateBeforeCall(userId, prefix, after, amount, effective, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUserPoliciesAsync(String userId, String prefix, String after, Integer amount, Boolean effective, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listUserPoliciesValidateBeforeCall(userId, prefix, after, amount, effective, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUserPoliciesRequest { + private final String userId; + private String prefix; + private String after; + private Integer amount; + private Boolean effective; + + private APIlistUserPoliciesRequest(String userId) { + this.userId = userId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistUserPoliciesRequest + */ + public APIlistUserPoliciesRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistUserPoliciesRequest + */ + public APIlistUserPoliciesRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistUserPoliciesRequest + */ + public APIlistUserPoliciesRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set effective + * @param effective will return all distinct policies attached to the user or any of its groups (optional, default to false) + * @return APIlistUserPoliciesRequest + */ + public APIlistUserPoliciesRequest effective(Boolean effective) { + this.effective = effective; + return this; + } + + /** + * Build call for listUserPolicies + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUserPoliciesCall(userId, prefix, after, amount, effective, _callback); + } + + /** + * Execute listUserPolicies request + * @return PolicyList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public PolicyList execute() throws ApiException { + ApiResponse localVarResp = listUserPoliciesWithHttpInfo(userId, prefix, after, amount, effective); + return localVarResp.getData(); + } + + /** + * Execute listUserPolicies request with HTTP info returned + * @return ApiResponse<PolicyList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUserPoliciesWithHttpInfo(userId, prefix, after, amount, effective); + } + + /** + * Execute listUserPolicies request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listUserPoliciesAsync(userId, prefix, after, amount, effective, _callback); + } + } + + /** + * list user policies + * + * @param userId (required) + * @return APIlistUserPoliciesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 policy list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistUserPoliciesRequest listUserPolicies(String userId) { + return new APIlistUserPoliciesRequest(userId); + } + private okhttp3.Call listUsersCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUsersValidateBeforeCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + return listUsersCall(prefix, after, amount, _callback); + + } + + + private ApiResponse listUsersWithHttpInfo(String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listUsersValidateBeforeCall(prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUsersAsync(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listUsersValidateBeforeCall(prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUsersRequest { + private String prefix; + private String after; + private Integer amount; + + private APIlistUsersRequest() { + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistUsersRequest + */ + public APIlistUsersRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistUsersRequest + */ + public APIlistUsersRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistUsersRequest + */ + public APIlistUsersRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listUsers + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 user list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUsersCall(prefix, after, amount, _callback); + } + + /** + * Execute listUsers request + * @return UserList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 user list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public UserList execute() throws ApiException { + ApiResponse localVarResp = listUsersWithHttpInfo(prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listUsers request with HTTP info returned + * @return ApiResponse<UserList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 user list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUsersWithHttpInfo(prefix, after, amount); + } + + /** + * Execute listUsers request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 user list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listUsersAsync(prefix, after, amount, _callback); + } + } + + /** + * list users + * + * @return APIlistUsersRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 user list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIlistUsersRequest listUsers() { + return new APIlistUsersRequest(); + } + private okhttp3.Call loginCall(LoginInformation loginInformation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = loginInformation; + + // create path and map variables + String localVarPath = "/auth/login"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call loginValidateBeforeCall(LoginInformation loginInformation, final ApiCallback _callback) throws ApiException { + return loginCall(loginInformation, _callback); + + } + + + private ApiResponse loginWithHttpInfo(LoginInformation loginInformation) throws ApiException { + okhttp3.Call localVarCall = loginValidateBeforeCall(loginInformation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call loginAsync(LoginInformation loginInformation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = loginValidateBeforeCall(loginInformation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIloginRequest { + private LoginInformation loginInformation; + + private APIloginRequest() { + } + + /** + * Set loginInformation + * @param loginInformation (optional) + * @return APIloginRequest + */ + public APIloginRequest loginInformation(LoginInformation loginInformation) { + this.loginInformation = loginInformation; + return this; + } + + /** + * Build call for login + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful login * Set-Cookie -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return loginCall(loginInformation, _callback); + } + + /** + * Execute login request + * @return AuthenticationToken + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful login * Set-Cookie -
401 Unauthorized -
0 Internal Server Error -
+ */ + public AuthenticationToken execute() throws ApiException { + ApiResponse localVarResp = loginWithHttpInfo(loginInformation); + return localVarResp.getData(); + } + + /** + * Execute login request with HTTP info returned + * @return ApiResponse<AuthenticationToken> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful login * Set-Cookie -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return loginWithHttpInfo(loginInformation); + } + + /** + * Execute login request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful login * Set-Cookie -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return loginAsync(loginInformation, _callback); + } + } + + /** + * perform a login + * + * @return APIloginRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful login * Set-Cookie -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIloginRequest login() { + return new APIloginRequest(); + } + private okhttp3.Call setGroupACLCall(String groupId, ACL ACL, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ACL; + + // create path and map variables + String localVarPath = "/auth/groups/{groupId}/acl" + .replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setGroupACLValidateBeforeCall(String groupId, ACL ACL, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException("Missing the required parameter 'groupId' when calling setGroupACL(Async)"); + } + + // verify the required parameter 'ACL' is set + if (ACL == null) { + throw new ApiException("Missing the required parameter 'ACL' when calling setGroupACL(Async)"); + } + + return setGroupACLCall(groupId, ACL, _callback); + + } + + + private ApiResponse setGroupACLWithHttpInfo(String groupId, ACL ACL) throws ApiException { + okhttp3.Call localVarCall = setGroupACLValidateBeforeCall(groupId, ACL, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call setGroupACLAsync(String groupId, ACL ACL, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setGroupACLValidateBeforeCall(groupId, ACL, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIsetGroupACLRequest { + private final String groupId; + private final ACL ACL; + + private APIsetGroupACLRequest(String groupId, ACL ACL) { + this.groupId = groupId; + this.ACL = ACL; + } + + /** + * Build call for setGroupACL + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 ACL successfully changed -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return setGroupACLCall(groupId, ACL, _callback); + } + + /** + * Execute setGroupACL request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 ACL successfully changed -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + setGroupACLWithHttpInfo(groupId, ACL); + } + + /** + * Execute setGroupACL request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 ACL successfully changed -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return setGroupACLWithHttpInfo(groupId, ACL); + } + + /** + * Execute setGroupACL request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 ACL successfully changed -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return setGroupACLAsync(groupId, ACL, _callback); + } + } + + /** + * set ACL of group + * + * @param groupId (required) + * @param ACL (required) + * @return APIsetGroupACLRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 ACL successfully changed -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIsetGroupACLRequest setGroupACL(String groupId, ACL ACL) { + return new APIsetGroupACLRequest(groupId, ACL); + } + private okhttp3.Call updatePolicyCall(String policyId, Policy policy, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = policy; + + // create path and map variables + String localVarPath = "/auth/policies/{policyId}" + .replace("{" + "policyId" + "}", localVarApiClient.escapeString(policyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePolicyValidateBeforeCall(String policyId, Policy policy, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'policyId' is set + if (policyId == null) { + throw new ApiException("Missing the required parameter 'policyId' when calling updatePolicy(Async)"); + } + + // verify the required parameter 'policy' is set + if (policy == null) { + throw new ApiException("Missing the required parameter 'policy' when calling updatePolicy(Async)"); + } + + return updatePolicyCall(policyId, policy, _callback); + + } + + + private ApiResponse updatePolicyWithHttpInfo(String policyId, Policy policy) throws ApiException { + okhttp3.Call localVarCall = updatePolicyValidateBeforeCall(policyId, policy, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call updatePolicyAsync(String policyId, Policy policy, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePolicyValidateBeforeCall(policyId, policy, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIupdatePolicyRequest { + private final String policyId; + private final Policy policy; + + private APIupdatePolicyRequest(String policyId, Policy policy) { + this.policyId = policyId; + this.policy = policy; + } + + /** + * Build call for updatePolicy + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 policy -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return updatePolicyCall(policyId, policy, _callback); + } + + /** + * Execute updatePolicy request + * @return Policy + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 policy -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Policy execute() throws ApiException { + ApiResponse localVarResp = updatePolicyWithHttpInfo(policyId, policy); + return localVarResp.getData(); + } + + /** + * Execute updatePolicy request with HTTP info returned + * @return ApiResponse<Policy> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 policy -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updatePolicyWithHttpInfo(policyId, policy); + } + + /** + * Execute updatePolicy request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 policy -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return updatePolicyAsync(policyId, policy, _callback); + } + } + + /** + * update policy + * + * @param policyId (required) + * @param policy (required) + * @return APIupdatePolicyRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 policy -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIupdatePolicyRequest updatePolicy(String policyId, Policy policy) { + return new APIupdatePolicyRequest(policyId, policy); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java new file mode 100644 index 00000000000..c1ec741c816 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java @@ -0,0 +1,1638 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.BranchCreation; +import io.lakefs.clients.sdk.model.CherryPickCreation; +import io.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.DiffList; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Ref; +import io.lakefs.clients.sdk.model.RefList; +import io.lakefs.clients.sdk.model.ResetCreation; +import io.lakefs.clients.sdk.model.RevertCreation; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BranchesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public BranchesApi() { + this(Configuration.getDefaultApiClient()); + } + + public BranchesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call cherryPickCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = cherryPickCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/cherry-pick" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cherryPickValidateBeforeCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling cherryPick(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling cherryPick(Async)"); + } + + // verify the required parameter 'cherryPickCreation' is set + if (cherryPickCreation == null) { + throw new ApiException("Missing the required parameter 'cherryPickCreation' when calling cherryPick(Async)"); + } + + return cherryPickCall(repository, branch, cherryPickCreation, _callback); + + } + + + private ApiResponse cherryPickWithHttpInfo(String repository, String branch, CherryPickCreation cherryPickCreation) throws ApiException { + okhttp3.Call localVarCall = cherryPickValidateBeforeCall(repository, branch, cherryPickCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call cherryPickAsync(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = cherryPickValidateBeforeCall(repository, branch, cherryPickCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcherryPickRequest { + private final String repository; + private final String branch; + private final CherryPickCreation cherryPickCreation; + + private APIcherryPickRequest(String repository, String branch, CherryPickCreation cherryPickCreation) { + this.repository = repository; + this.branch = branch; + this.cherryPickCreation = cherryPickCreation; + } + + /** + * Build call for cherryPick + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 the cherry-pick commit -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return cherryPickCall(repository, branch, cherryPickCreation, _callback); + } + + /** + * Execute cherryPick request + * @return Commit + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 the cherry-pick commit -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public Commit execute() throws ApiException { + ApiResponse localVarResp = cherryPickWithHttpInfo(repository, branch, cherryPickCreation); + return localVarResp.getData(); + } + + /** + * Execute cherryPick request with HTTP info returned + * @return ApiResponse<Commit> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 the cherry-pick commit -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return cherryPickWithHttpInfo(repository, branch, cherryPickCreation); + } + + /** + * Execute cherryPick request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 the cherry-pick commit -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return cherryPickAsync(repository, branch, cherryPickCreation, _callback); + } + } + + /** + * Replay the changes from the given commit on the branch + * + * @param repository (required) + * @param branch (required) + * @param cherryPickCreation (required) + * @return APIcherryPickRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 the cherry-pick commit -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public APIcherryPickRequest cherryPick(String repository, String branch, CherryPickCreation cherryPickCreation) { + return new APIcherryPickRequest(repository, branch, cherryPickCreation); + } + private okhttp3.Call createBranchCall(String repository, BranchCreation branchCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = branchCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/html", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBranchValidateBeforeCall(String repository, BranchCreation branchCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling createBranch(Async)"); + } + + // verify the required parameter 'branchCreation' is set + if (branchCreation == null) { + throw new ApiException("Missing the required parameter 'branchCreation' when calling createBranch(Async)"); + } + + return createBranchCall(repository, branchCreation, _callback); + + } + + + private ApiResponse createBranchWithHttpInfo(String repository, BranchCreation branchCreation) throws ApiException { + okhttp3.Call localVarCall = createBranchValidateBeforeCall(repository, branchCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createBranchAsync(String repository, BranchCreation branchCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBranchValidateBeforeCall(repository, branchCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateBranchRequest { + private final String repository; + private final BranchCreation branchCreation; + + private APIcreateBranchRequest(String repository, BranchCreation branchCreation) { + this.repository = repository; + this.branchCreation = branchCreation; + } + + /** + * Build call for createBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createBranchCall(repository, branchCreation, _callback); + } + + /** + * Execute createBranch request + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public String execute() throws ApiException { + ApiResponse localVarResp = createBranchWithHttpInfo(repository, branchCreation); + return localVarResp.getData(); + } + + /** + * Execute createBranch request with HTTP info returned + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createBranchWithHttpInfo(repository, branchCreation); + } + + /** + * Execute createBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createBranchAsync(repository, branchCreation, _callback); + } + } + + /** + * create branch + * + * @param repository (required) + * @param branchCreation (required) + * @return APIcreateBranchRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreateBranchRequest createBranch(String repository, BranchCreation branchCreation) { + return new APIcreateBranchRequest(repository, branchCreation); + } + private okhttp3.Call deleteBranchCall(String repository, String branch, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteBranchValidateBeforeCall(String repository, String branch, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling deleteBranch(Async)"); + } + + return deleteBranchCall(repository, branch, _callback); + + } + + + private ApiResponse deleteBranchWithHttpInfo(String repository, String branch) throws ApiException { + okhttp3.Call localVarCall = deleteBranchValidateBeforeCall(repository, branch, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteBranchAsync(String repository, String branch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteBranchValidateBeforeCall(repository, branch, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteBranchRequest { + private final String repository; + private final String branch; + + private APIdeleteBranchRequest(String repository, String branch) { + this.repository = repository; + this.branch = branch; + } + + /** + * Build call for deleteBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 branch deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteBranchCall(repository, branch, _callback); + } + + /** + * Execute deleteBranch request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 branch deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteBranchWithHttpInfo(repository, branch); + } + + /** + * Execute deleteBranch request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 branch deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteBranchWithHttpInfo(repository, branch); + } + + /** + * Execute deleteBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 branch deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteBranchAsync(repository, branch, _callback); + } + } + + /** + * delete branch + * + * @param repository (required) + * @param branch (required) + * @return APIdeleteBranchRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 branch deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteBranchRequest deleteBranch(String repository, String branch) { + return new APIdeleteBranchRequest(repository, branch); + } + private okhttp3.Call diffBranchCall(String repository, String branch, String after, Integer amount, String prefix, String delimiter, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/diff" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (delimiter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delimiter", delimiter)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call diffBranchValidateBeforeCall(String repository, String branch, String after, Integer amount, String prefix, String delimiter, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling diffBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling diffBranch(Async)"); + } + + return diffBranchCall(repository, branch, after, amount, prefix, delimiter, _callback); + + } + + + private ApiResponse diffBranchWithHttpInfo(String repository, String branch, String after, Integer amount, String prefix, String delimiter) throws ApiException { + okhttp3.Call localVarCall = diffBranchValidateBeforeCall(repository, branch, after, amount, prefix, delimiter, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call diffBranchAsync(String repository, String branch, String after, Integer amount, String prefix, String delimiter, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = diffBranchValidateBeforeCall(repository, branch, after, amount, prefix, delimiter, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIdiffBranchRequest { + private final String repository; + private final String branch; + private String after; + private Integer amount; + private String prefix; + private String delimiter; + + private APIdiffBranchRequest(String repository, String branch) { + this.repository = repository; + this.branch = branch; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIdiffBranchRequest + */ + public APIdiffBranchRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIdiffBranchRequest + */ + public APIdiffBranchRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIdiffBranchRequest + */ + public APIdiffBranchRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set delimiter + * @param delimiter delimiter used to group common prefixes by (optional) + * @return APIdiffBranchRequest + */ + public APIdiffBranchRequest delimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Build call for diffBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff of branch uncommitted changes -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return diffBranchCall(repository, branch, after, amount, prefix, delimiter, _callback); + } + + /** + * Execute diffBranch request + * @return DiffList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff of branch uncommitted changes -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public DiffList execute() throws ApiException { + ApiResponse localVarResp = diffBranchWithHttpInfo(repository, branch, after, amount, prefix, delimiter); + return localVarResp.getData(); + } + + /** + * Execute diffBranch request with HTTP info returned + * @return ApiResponse<DiffList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff of branch uncommitted changes -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return diffBranchWithHttpInfo(repository, branch, after, amount, prefix, delimiter); + } + + /** + * Execute diffBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff of branch uncommitted changes -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return diffBranchAsync(repository, branch, after, amount, prefix, delimiter, _callback); + } + } + + /** + * diff branch + * + * @param repository (required) + * @param branch (required) + * @return APIdiffBranchRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff of branch uncommitted changes -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdiffBranchRequest diffBranch(String repository, String branch) { + return new APIdiffBranchRequest(repository, branch); + } + private okhttp3.Call getBranchCall(String repository, String branch, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBranchValidateBeforeCall(String repository, String branch, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling getBranch(Async)"); + } + + return getBranchCall(repository, branch, _callback); + + } + + + private ApiResponse getBranchWithHttpInfo(String repository, String branch) throws ApiException { + okhttp3.Call localVarCall = getBranchValidateBeforeCall(repository, branch, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getBranchAsync(String repository, String branch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBranchValidateBeforeCall(repository, branch, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetBranchRequest { + private final String repository; + private final String branch; + + private APIgetBranchRequest(String repository, String branch) { + this.repository = repository; + this.branch = branch; + } + + /** + * Build call for getBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getBranchCall(repository, branch, _callback); + } + + /** + * Execute getBranch request + * @return Ref + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Ref execute() throws ApiException { + ApiResponse localVarResp = getBranchWithHttpInfo(repository, branch); + return localVarResp.getData(); + } + + /** + * Execute getBranch request with HTTP info returned + * @return ApiResponse<Ref> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getBranchWithHttpInfo(repository, branch); + } + + /** + * Execute getBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getBranchAsync(repository, branch, _callback); + } + } + + /** + * get branch + * + * @param repository (required) + * @param branch (required) + * @return APIgetBranchRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetBranchRequest getBranch(String repository, String branch) { + return new APIgetBranchRequest(repository, branch); + } + private okhttp3.Call listBranchesCall(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listBranchesValidateBeforeCall(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling listBranches(Async)"); + } + + return listBranchesCall(repository, prefix, after, amount, _callback); + + } + + + private ApiResponse listBranchesWithHttpInfo(String repository, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listBranchesValidateBeforeCall(repository, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listBranchesAsync(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listBranchesValidateBeforeCall(repository, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistBranchesRequest { + private final String repository; + private String prefix; + private String after; + private Integer amount; + + private APIlistBranchesRequest(String repository) { + this.repository = repository; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistBranchesRequest + */ + public APIlistBranchesRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistBranchesRequest + */ + public APIlistBranchesRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistBranchesRequest + */ + public APIlistBranchesRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listBranches + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listBranchesCall(repository, prefix, after, amount, _callback); + } + + /** + * Execute listBranches request + * @return RefList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public RefList execute() throws ApiException { + ApiResponse localVarResp = listBranchesWithHttpInfo(repository, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listBranches request with HTTP info returned + * @return ApiResponse<RefList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listBranchesWithHttpInfo(repository, prefix, after, amount); + } + + /** + * Execute listBranches request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listBranchesAsync(repository, prefix, after, amount, _callback); + } + } + + /** + * list branches + * + * @param repository (required) + * @return APIlistBranchesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistBranchesRequest listBranches(String repository) { + return new APIlistBranchesRequest(repository); + } + private okhttp3.Call resetBranchCall(String repository, String branch, ResetCreation resetCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = resetCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetBranchValidateBeforeCall(String repository, String branch, ResetCreation resetCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling resetBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling resetBranch(Async)"); + } + + // verify the required parameter 'resetCreation' is set + if (resetCreation == null) { + throw new ApiException("Missing the required parameter 'resetCreation' when calling resetBranch(Async)"); + } + + return resetBranchCall(repository, branch, resetCreation, _callback); + + } + + + private ApiResponse resetBranchWithHttpInfo(String repository, String branch, ResetCreation resetCreation) throws ApiException { + okhttp3.Call localVarCall = resetBranchValidateBeforeCall(repository, branch, resetCreation, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call resetBranchAsync(String repository, String branch, ResetCreation resetCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = resetBranchValidateBeforeCall(repository, branch, resetCreation, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIresetBranchRequest { + private final String repository; + private final String branch; + private final ResetCreation resetCreation; + + private APIresetBranchRequest(String repository, String branch, ResetCreation resetCreation) { + this.repository = repository; + this.branch = branch; + this.resetCreation = resetCreation; + } + + /** + * Build call for resetBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return resetBranchCall(repository, branch, resetCreation, _callback); + } + + /** + * Execute resetBranch request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + resetBranchWithHttpInfo(repository, branch, resetCreation); + } + + /** + * Execute resetBranch request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return resetBranchWithHttpInfo(repository, branch, resetCreation); + } + + /** + * Execute resetBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return resetBranchAsync(repository, branch, resetCreation, _callback); + } + } + + /** + * reset branch + * + * @param repository (required) + * @param branch (required) + * @param resetCreation (required) + * @return APIresetBranchRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIresetBranchRequest resetBranch(String repository, String branch, ResetCreation resetCreation) { + return new APIresetBranchRequest(repository, branch, resetCreation); + } + private okhttp3.Call revertBranchCall(String repository, String branch, RevertCreation revertCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = revertCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/revert" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revertBranchValidateBeforeCall(String repository, String branch, RevertCreation revertCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling revertBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling revertBranch(Async)"); + } + + // verify the required parameter 'revertCreation' is set + if (revertCreation == null) { + throw new ApiException("Missing the required parameter 'revertCreation' when calling revertBranch(Async)"); + } + + return revertBranchCall(repository, branch, revertCreation, _callback); + + } + + + private ApiResponse revertBranchWithHttpInfo(String repository, String branch, RevertCreation revertCreation) throws ApiException { + okhttp3.Call localVarCall = revertBranchValidateBeforeCall(repository, branch, revertCreation, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call revertBranchAsync(String repository, String branch, RevertCreation revertCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = revertBranchValidateBeforeCall(repository, branch, revertCreation, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIrevertBranchRequest { + private final String repository; + private final String branch; + private final RevertCreation revertCreation; + + private APIrevertBranchRequest(String repository, String branch, RevertCreation revertCreation) { + this.repository = repository; + this.branch = branch; + this.revertCreation = revertCreation; + } + + /** + * Build call for revertBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 revert successful -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return revertBranchCall(repository, branch, revertCreation, _callback); + } + + /** + * Execute revertBranch request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 revert successful -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + revertBranchWithHttpInfo(repository, branch, revertCreation); + } + + /** + * Execute revertBranch request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 revert successful -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return revertBranchWithHttpInfo(repository, branch, revertCreation); + } + + /** + * Execute revertBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 revert successful -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return revertBranchAsync(repository, branch, revertCreation, _callback); + } + } + + /** + * revert + * + * @param repository (required) + * @param branch (required) + * @param revertCreation (required) + * @return APIrevertBranchRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 revert successful -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public APIrevertBranchRequest revertBranch(String repository, String branch, RevertCreation revertCreation) { + return new APIrevertBranchRequest(repository, branch, revertCreation); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java new file mode 100644 index 00000000000..76c2e55b5da --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java @@ -0,0 +1,468 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.CommitCreation; +import io.lakefs.clients.sdk.model.Error; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CommitsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CommitsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CommitsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call commitCall(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/commits" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sourceMetarange != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("source_metarange", sourceMetarange)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call commitValidateBeforeCall(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling commit(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling commit(Async)"); + } + + // verify the required parameter 'commitCreation' is set + if (commitCreation == null) { + throw new ApiException("Missing the required parameter 'commitCreation' when calling commit(Async)"); + } + + return commitCall(repository, branch, commitCreation, sourceMetarange, _callback); + + } + + + private ApiResponse commitWithHttpInfo(String repository, String branch, CommitCreation commitCreation, String sourceMetarange) throws ApiException { + okhttp3.Call localVarCall = commitValidateBeforeCall(repository, branch, commitCreation, sourceMetarange, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call commitAsync(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = commitValidateBeforeCall(repository, branch, commitCreation, sourceMetarange, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcommitRequest { + private final String repository; + private final String branch; + private final CommitCreation commitCreation; + private String sourceMetarange; + + private APIcommitRequest(String repository, String branch, CommitCreation commitCreation) { + this.repository = repository; + this.branch = branch; + this.commitCreation = commitCreation; + } + + /** + * Set sourceMetarange + * @param sourceMetarange The source metarange to commit. Branch must not have uncommitted changes. (optional) + * @return APIcommitRequest + */ + public APIcommitRequest sourceMetarange(String sourceMetarange) { + this.sourceMetarange = sourceMetarange; + return this; + } + + /** + * Build call for commit + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 commit -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed (e.g. a pre-commit hook returned a failure) -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return commitCall(repository, branch, commitCreation, sourceMetarange, _callback); + } + + /** + * Execute commit request + * @return Commit + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 commit -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed (e.g. a pre-commit hook returned a failure) -
0 Internal Server Error -
+ */ + public Commit execute() throws ApiException { + ApiResponse localVarResp = commitWithHttpInfo(repository, branch, commitCreation, sourceMetarange); + return localVarResp.getData(); + } + + /** + * Execute commit request with HTTP info returned + * @return ApiResponse<Commit> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 commit -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed (e.g. a pre-commit hook returned a failure) -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return commitWithHttpInfo(repository, branch, commitCreation, sourceMetarange); + } + + /** + * Execute commit request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 commit -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed (e.g. a pre-commit hook returned a failure) -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return commitAsync(repository, branch, commitCreation, sourceMetarange, _callback); + } + } + + /** + * create commit + * + * @param repository (required) + * @param branch (required) + * @param commitCreation (required) + * @return APIcommitRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 commit -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed (e.g. a pre-commit hook returned a failure) -
0 Internal Server Error -
+ */ + public APIcommitRequest commit(String repository, String branch, CommitCreation commitCreation) { + return new APIcommitRequest(repository, branch, commitCreation); + } + private okhttp3.Call getCommitCall(String repository, String commitId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/commits/{commitId}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "commitId" + "}", localVarApiClient.escapeString(commitId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCommitValidateBeforeCall(String repository, String commitId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getCommit(Async)"); + } + + // verify the required parameter 'commitId' is set + if (commitId == null) { + throw new ApiException("Missing the required parameter 'commitId' when calling getCommit(Async)"); + } + + return getCommitCall(repository, commitId, _callback); + + } + + + private ApiResponse getCommitWithHttpInfo(String repository, String commitId) throws ApiException { + okhttp3.Call localVarCall = getCommitValidateBeforeCall(repository, commitId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getCommitAsync(String repository, String commitId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCommitValidateBeforeCall(repository, commitId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetCommitRequest { + private final String repository; + private final String commitId; + + private APIgetCommitRequest(String repository, String commitId) { + this.repository = repository; + this.commitId = commitId; + } + + /** + * Build call for getCommit + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getCommitCall(repository, commitId, _callback); + } + + /** + * Execute getCommit request + * @return Commit + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Commit execute() throws ApiException { + ApiResponse localVarResp = getCommitWithHttpInfo(repository, commitId); + return localVarResp.getData(); + } + + /** + * Execute getCommit request with HTTP info returned + * @return ApiResponse<Commit> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getCommitWithHttpInfo(repository, commitId); + } + + /** + * Execute getCommit request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getCommitAsync(repository, commitId, _callback); + } + } + + /** + * get commit + * + * @param repository (required) + * @param commitId (required) + * @return APIgetCommitRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetCommitRequest getCommit(String repository, String commitId) { + return new APIgetCommitRequest(repository, commitId); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ConfigApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ConfigApi.java new file mode 100644 index 00000000000..e26ec710be0 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ConfigApi.java @@ -0,0 +1,522 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.GarbageCollectionConfig; +import io.lakefs.clients.sdk.model.StorageConfig; +import io.lakefs.clients.sdk.model.VersionConfig; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ConfigApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ConfigApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConfigApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call getGarbageCollectionConfigCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config/garbage-collection"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGarbageCollectionConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getGarbageCollectionConfigCall(_callback); + + } + + + private ApiResponse getGarbageCollectionConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getGarbageCollectionConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getGarbageCollectionConfigAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGarbageCollectionConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetGarbageCollectionConfigRequest { + + private APIgetGarbageCollectionConfigRequest() { + } + + /** + * Build call for getGarbageCollectionConfig + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS garbage collection config -
401 Unauthorized -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getGarbageCollectionConfigCall(_callback); + } + + /** + * Execute getGarbageCollectionConfig request + * @return GarbageCollectionConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS garbage collection config -
401 Unauthorized -
+ */ + public GarbageCollectionConfig execute() throws ApiException { + ApiResponse localVarResp = getGarbageCollectionConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getGarbageCollectionConfig request with HTTP info returned + * @return ApiResponse<GarbageCollectionConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS garbage collection config -
401 Unauthorized -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getGarbageCollectionConfigWithHttpInfo(); + } + + /** + * Execute getGarbageCollectionConfig request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS garbage collection config -
401 Unauthorized -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getGarbageCollectionConfigAsync(_callback); + } + } + + /** + * + * get information of gc settings + * @return APIgetGarbageCollectionConfigRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS garbage collection config -
401 Unauthorized -
+ */ + public APIgetGarbageCollectionConfigRequest getGarbageCollectionConfig() { + return new APIgetGarbageCollectionConfigRequest(); + } + private okhttp3.Call getLakeFSVersionCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config/version"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLakeFSVersionValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getLakeFSVersionCall(_callback); + + } + + + private ApiResponse getLakeFSVersionWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getLakeFSVersionAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetLakeFSVersionRequest { + + private APIgetLakeFSVersionRequest() { + } + + /** + * Build call for getLakeFSVersion + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS version -
401 Unauthorized -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getLakeFSVersionCall(_callback); + } + + /** + * Execute getLakeFSVersion request + * @return VersionConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS version -
401 Unauthorized -
+ */ + public VersionConfig execute() throws ApiException { + ApiResponse localVarResp = getLakeFSVersionWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getLakeFSVersion request with HTTP info returned + * @return ApiResponse<VersionConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS version -
401 Unauthorized -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getLakeFSVersionWithHttpInfo(); + } + + /** + * Execute getLakeFSVersion request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS version -
401 Unauthorized -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getLakeFSVersionAsync(_callback); + } + } + + /** + * + * get version of lakeFS server + * @return APIgetLakeFSVersionRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS version -
401 Unauthorized -
+ */ + public APIgetLakeFSVersionRequest getLakeFSVersion() { + return new APIgetLakeFSVersionRequest(); + } + private okhttp3.Call getStorageConfigCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config/storage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStorageConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getStorageConfigCall(_callback); + + } + + + private ApiResponse getStorageConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getStorageConfigAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetStorageConfigRequest { + + private APIgetStorageConfigRequest() { + } + + /** + * Build call for getStorageConfig + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS storage configuration -
401 Unauthorized -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getStorageConfigCall(_callback); + } + + /** + * Execute getStorageConfig request + * @return StorageConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS storage configuration -
401 Unauthorized -
+ */ + public StorageConfig execute() throws ApiException { + ApiResponse localVarResp = getStorageConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getStorageConfig request with HTTP info returned + * @return ApiResponse<StorageConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS storage configuration -
401 Unauthorized -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getStorageConfigWithHttpInfo(); + } + + /** + * Execute getStorageConfig request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS storage configuration -
401 Unauthorized -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getStorageConfigAsync(_callback); + } + } + + /** + * + * retrieve lakeFS storage configuration + * @return APIgetStorageConfigRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS storage configuration -
401 Unauthorized -
+ */ + public APIgetStorageConfigRequest getStorageConfig() { + return new APIgetStorageConfigRequest(); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java b/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java new file mode 100644 index 00000000000..0dc9dc1e86e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java @@ -0,0 +1,41 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "0.1.0-SNAPSHOT"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java new file mode 100644 index 00000000000..71e976a2f26 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java @@ -0,0 +1,444 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.OTFDiffs; +import io.lakefs.clients.sdk.model.OtfDiffList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ExperimentalApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ExperimentalApi() { + this(Configuration.getDefaultApiClient()); + } + + public ExperimentalApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call getOtfDiffsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/otf/diffs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOtfDiffsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOtfDiffsCall(_callback); + + } + + + private ApiResponse getOtfDiffsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOtfDiffsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getOtfDiffsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOtfDiffsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetOtfDiffsRequest { + + private APIgetOtfDiffsRequest() { + } + + /** + * Build call for getOtfDiffs + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 available Open Table Format diffs -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getOtfDiffsCall(_callback); + } + + /** + * Execute getOtfDiffs request + * @return OTFDiffs + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 available Open Table Format diffs -
401 Unauthorized -
0 Internal Server Error -
+ */ + public OTFDiffs execute() throws ApiException { + ApiResponse localVarResp = getOtfDiffsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getOtfDiffs request with HTTP info returned + * @return ApiResponse<OTFDiffs> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 available Open Table Format diffs -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getOtfDiffsWithHttpInfo(); + } + + /** + * Execute getOtfDiffs request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 available Open Table Format diffs -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getOtfDiffsAsync(_callback); + } + } + + /** + * get the available Open Table Format diffs + * + * @return APIgetOtfDiffsRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 available Open Table Format diffs -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIgetOtfDiffsRequest getOtfDiffs() { + return new APIgetOtfDiffsRequest(); + } + private okhttp3.Call otfDiffCall(String repository, String leftRef, String rightRef, String tablePath, String type, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "left_ref" + "}", localVarApiClient.escapeString(leftRef.toString())) + .replace("{" + "right_ref" + "}", localVarApiClient.escapeString(rightRef.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (tablePath != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("table_path", tablePath)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call otfDiffValidateBeforeCall(String repository, String leftRef, String rightRef, String tablePath, String type, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling otfDiff(Async)"); + } + + // verify the required parameter 'leftRef' is set + if (leftRef == null) { + throw new ApiException("Missing the required parameter 'leftRef' when calling otfDiff(Async)"); + } + + // verify the required parameter 'rightRef' is set + if (rightRef == null) { + throw new ApiException("Missing the required parameter 'rightRef' when calling otfDiff(Async)"); + } + + // verify the required parameter 'tablePath' is set + if (tablePath == null) { + throw new ApiException("Missing the required parameter 'tablePath' when calling otfDiff(Async)"); + } + + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling otfDiff(Async)"); + } + + return otfDiffCall(repository, leftRef, rightRef, tablePath, type, _callback); + + } + + + private ApiResponse otfDiffWithHttpInfo(String repository, String leftRef, String rightRef, String tablePath, String type) throws ApiException { + okhttp3.Call localVarCall = otfDiffValidateBeforeCall(repository, leftRef, rightRef, tablePath, type, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call otfDiffAsync(String repository, String leftRef, String rightRef, String tablePath, String type, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = otfDiffValidateBeforeCall(repository, leftRef, rightRef, tablePath, type, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIotfDiffRequest { + private final String repository; + private final String leftRef; + private final String rightRef; + private final String tablePath; + private final String type; + + private APIotfDiffRequest(String repository, String leftRef, String rightRef, String tablePath, String type) { + this.repository = repository; + this.leftRef = leftRef; + this.rightRef = rightRef; + this.tablePath = tablePath; + this.type = type; + } + + /** + * Build call for otfDiff + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 diff list -
401 Unauthorized -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return otfDiffCall(repository, leftRef, rightRef, tablePath, type, _callback); + } + + /** + * Execute otfDiff request + * @return OtfDiffList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 diff list -
401 Unauthorized -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public OtfDiffList execute() throws ApiException { + ApiResponse localVarResp = otfDiffWithHttpInfo(repository, leftRef, rightRef, tablePath, type); + return localVarResp.getData(); + } + + /** + * Execute otfDiff request with HTTP info returned + * @return ApiResponse<OtfDiffList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 diff list -
401 Unauthorized -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return otfDiffWithHttpInfo(repository, leftRef, rightRef, tablePath, type); + } + + /** + * Execute otfDiff request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 diff list -
401 Unauthorized -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return otfDiffAsync(repository, leftRef, rightRef, tablePath, type, _callback); + } + } + + /** + * perform otf diff + * + * @param repository (required) + * @param leftRef (required) + * @param rightRef (required) + * @param tablePath a path to the table location under the specified ref. (required) + * @param type the type of otf (required) + * @return APIotfDiffRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 diff list -
401 Unauthorized -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public APIotfDiffRequest otfDiff(String repository, String leftRef, String rightRef, String tablePath, String type) { + return new APIotfDiffRequest(repository, leftRef, rightRef, tablePath, type); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/GzipRequestInterceptor.java b/clients/java/src/main/java/io/lakefs/clients/sdk/GzipRequestInterceptor.java new file mode 100644 index 00000000000..405e3854d92 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/HealthCheckApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/HealthCheckApi.java new file mode 100644 index 00000000000..c22fca81211 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/HealthCheckApi.java @@ -0,0 +1,212 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HealthCheckApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public HealthCheckApi() { + this(Configuration.getDefaultApiClient()); + } + + public HealthCheckApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call healthCheckCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/healthcheck"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call healthCheckValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return healthCheckCall(_callback); + + } + + + private ApiResponse healthCheckWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = healthCheckValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call healthCheckAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = healthCheckValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIhealthCheckRequest { + + private APIhealthCheckRequest() { + } + + /** + * Build call for healthCheck + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
204 NoContent -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return healthCheckCall(_callback); + } + + /** + * Execute healthCheck request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
204 NoContent -
+ */ + public void execute() throws ApiException { + healthCheckWithHttpInfo(); + } + + /** + * Execute healthCheck request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
204 NoContent -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return healthCheckWithHttpInfo(); + } + + /** + * Execute healthCheck request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
204 NoContent -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return healthCheckAsync(_callback); + } + } + + /** + * + * check that the API server is up and running + * @return APIhealthCheckRequest + * @http.response.details + + + +
Status Code Description Response Headers
204 NoContent -
+ */ + public APIhealthCheckRequest healthCheck() { + return new APIhealthCheckRequest(); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ImportApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ImportApi.java new file mode 100644 index 00000000000..7c769da4add --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ImportApi.java @@ -0,0 +1,650 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ImportCreation; +import io.lakefs.clients.sdk.model.ImportCreationResponse; +import io.lakefs.clients.sdk.model.ImportStatus; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ImportApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ImportApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImportApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call importCancelCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/import" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (id != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call importCancelValidateBeforeCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling importCancel(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling importCancel(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling importCancel(Async)"); + } + + return importCancelCall(repository, branch, id, _callback); + + } + + + private ApiResponse importCancelWithHttpInfo(String repository, String branch, String id) throws ApiException { + okhttp3.Call localVarCall = importCancelValidateBeforeCall(repository, branch, id, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call importCancelAsync(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = importCancelValidateBeforeCall(repository, branch, id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIimportCancelRequest { + private final String repository; + private final String branch; + private final String id; + + private APIimportCancelRequest(String repository, String branch, String id) { + this.repository = repository; + this.branch = branch; + this.id = id; + } + + /** + * Build call for importCancel + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return importCancelCall(repository, branch, id, _callback); + } + + /** + * Execute importCancel request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + importCancelWithHttpInfo(repository, branch, id); + } + + /** + * Execute importCancel request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return importCancelWithHttpInfo(repository, branch, id); + } + + /** + * Execute importCancel request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return importCancelAsync(repository, branch, id, _callback); + } + } + + /** + * cancel ongoing import + * + * @param repository (required) + * @param branch (required) + * @param id Unique identifier of the import process (required) + * @return APIimportCancelRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIimportCancelRequest importCancel(String repository, String branch, String id) { + return new APIimportCancelRequest(repository, branch, id); + } + private okhttp3.Call importStartCall(String repository, String branch, ImportCreation importCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = importCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/import" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call importStartValidateBeforeCall(String repository, String branch, ImportCreation importCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling importStart(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling importStart(Async)"); + } + + // verify the required parameter 'importCreation' is set + if (importCreation == null) { + throw new ApiException("Missing the required parameter 'importCreation' when calling importStart(Async)"); + } + + return importStartCall(repository, branch, importCreation, _callback); + + } + + + private ApiResponse importStartWithHttpInfo(String repository, String branch, ImportCreation importCreation) throws ApiException { + okhttp3.Call localVarCall = importStartValidateBeforeCall(repository, branch, importCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call importStartAsync(String repository, String branch, ImportCreation importCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = importStartValidateBeforeCall(repository, branch, importCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIimportStartRequest { + private final String repository; + private final String branch; + private final ImportCreation importCreation; + + private APIimportStartRequest(String repository, String branch, ImportCreation importCreation) { + this.repository = repository; + this.branch = branch; + this.importCreation = importCreation; + } + + /** + * Build call for importStart + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return importStartCall(repository, branch, importCreation, _callback); + } + + /** + * Execute importStart request + * @return ImportCreationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ImportCreationResponse execute() throws ApiException { + ApiResponse localVarResp = importStartWithHttpInfo(repository, branch, importCreation); + return localVarResp.getData(); + } + + /** + * Execute importStart request with HTTP info returned + * @return ApiResponse<ImportCreationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return importStartWithHttpInfo(repository, branch, importCreation); + } + + /** + * Execute importStart request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return importStartAsync(repository, branch, importCreation, _callback); + } + } + + /** + * import data from object store + * + * @param repository (required) + * @param branch (required) + * @param importCreation (required) + * @return APIimportStartRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIimportStartRequest importStart(String repository, String branch, ImportCreation importCreation) { + return new APIimportStartRequest(repository, branch, importCreation); + } + private okhttp3.Call importStatusCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/import" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (id != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call importStatusValidateBeforeCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling importStatus(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling importStatus(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling importStatus(Async)"); + } + + return importStatusCall(repository, branch, id, _callback); + + } + + + private ApiResponse importStatusWithHttpInfo(String repository, String branch, String id) throws ApiException { + okhttp3.Call localVarCall = importStatusValidateBeforeCall(repository, branch, id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call importStatusAsync(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = importStatusValidateBeforeCall(repository, branch, id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIimportStatusRequest { + private final String repository; + private final String branch; + private final String id; + + private APIimportStatusRequest(String repository, String branch, String id) { + this.repository = repository; + this.branch = branch; + this.id = id; + } + + /** + * Build call for importStatus + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return importStatusCall(repository, branch, id, _callback); + } + + /** + * Execute importStatus request + * @return ImportStatus + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ImportStatus execute() throws ApiException { + ApiResponse localVarResp = importStatusWithHttpInfo(repository, branch, id); + return localVarResp.getData(); + } + + /** + * Execute importStatus request with HTTP info returned + * @return ApiResponse<ImportStatus> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return importStatusWithHttpInfo(repository, branch, id); + } + + /** + * Execute importStatus request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return importStatusAsync(repository, branch, id, _callback); + } + } + + /** + * get import status + * + * @param repository (required) + * @param branch (required) + * @param id Unique identifier of the import process (required) + * @return APIimportStatusRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIimportStatusRequest importStatus(String repository, String branch, String id) { + return new APIimportStatusRequest(repository, branch, id); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/InternalApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/InternalApi.java new file mode 100644 index 00000000000..c2099471734 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/InternalApi.java @@ -0,0 +1,1582 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.AuthCapabilities; +import io.lakefs.clients.sdk.model.CommPrefsInput; +import io.lakefs.clients.sdk.model.CredentialsWithSecret; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Setup; +import io.lakefs.clients.sdk.model.SetupState; +import io.lakefs.clients.sdk.model.StatsEventsList; +import io.lakefs.clients.sdk.model.StorageURI; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InternalApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InternalApi() { + this(Configuration.getDefaultApiClient()); + } + + public InternalApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call createBranchProtectionRulePreflightCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branch_protection/set_allowed" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBranchProtectionRulePreflightValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling createBranchProtectionRulePreflight(Async)"); + } + + return createBranchProtectionRulePreflightCall(repository, _callback); + + } + + + private ApiResponse createBranchProtectionRulePreflightWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = createBranchProtectionRulePreflightValidateBeforeCall(repository, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call createBranchProtectionRulePreflightAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBranchProtectionRulePreflightValidateBeforeCall(repository, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIcreateBranchProtectionRulePreflightRequest { + private final String repository; + + private APIcreateBranchProtectionRulePreflightRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for createBranchProtectionRulePreflight + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to create a branch protection rule in this repository -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createBranchProtectionRulePreflightCall(repository, _callback); + } + + /** + * Execute createBranchProtectionRulePreflight request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to create a branch protection rule in this repository -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + createBranchProtectionRulePreflightWithHttpInfo(repository); + } + + /** + * Execute createBranchProtectionRulePreflight request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to create a branch protection rule in this repository -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createBranchProtectionRulePreflightWithHttpInfo(repository); + } + + /** + * Execute createBranchProtectionRulePreflight request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to create a branch protection rule in this repository -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createBranchProtectionRulePreflightAsync(repository, _callback); + } + } + + /** + * + * + * @param repository (required) + * @return APIcreateBranchProtectionRulePreflightRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to create a branch protection rule in this repository -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreateBranchProtectionRulePreflightRequest createBranchProtectionRulePreflight(String repository) { + return new APIcreateBranchProtectionRulePreflightRequest(repository); + } + private okhttp3.Call createSymlinkFileCall(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{branch}/symlink" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (location != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("location", location)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSymlinkFileValidateBeforeCall(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling createSymlinkFile(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling createSymlinkFile(Async)"); + } + + return createSymlinkFileCall(repository, branch, location, _callback); + + } + + + private ApiResponse createSymlinkFileWithHttpInfo(String repository, String branch, String location) throws ApiException { + okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createSymlinkFileAsync(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateSymlinkFileRequest { + private final String repository; + private final String branch; + private String location; + + private APIcreateSymlinkFileRequest(String repository, String branch) { + this.repository = repository; + this.branch = branch; + } + + /** + * Set location + * @param location path to the table data (optional) + * @return APIcreateSymlinkFileRequest + */ + public APIcreateSymlinkFileRequest location(String location) { + this.location = location; + return this; + } + + /** + * Build call for createSymlinkFile + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createSymlinkFileCall(repository, branch, location, _callback); + } + + /** + * Execute createSymlinkFile request + * @return StorageURI + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public StorageURI execute() throws ApiException { + ApiResponse localVarResp = createSymlinkFileWithHttpInfo(repository, branch, location); + return localVarResp.getData(); + } + + /** + * Execute createSymlinkFile request with HTTP info returned + * @return ApiResponse<StorageURI> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createSymlinkFileWithHttpInfo(repository, branch, location); + } + + /** + * Execute createSymlinkFile request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createSymlinkFileAsync(repository, branch, location, _callback); + } + } + + /** + * creates symlink files corresponding to the given directory + * + * @param repository (required) + * @param branch (required) + * @return APIcreateSymlinkFileRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIcreateSymlinkFileRequest createSymlinkFile(String repository, String branch) { + return new APIcreateSymlinkFileRequest(repository, branch); + } + private okhttp3.Call getAuthCapabilitiesCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/capabilities"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAuthCapabilitiesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAuthCapabilitiesCall(_callback); + + } + + + private ApiResponse getAuthCapabilitiesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAuthCapabilitiesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getAuthCapabilitiesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAuthCapabilitiesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetAuthCapabilitiesRequest { + + private APIgetAuthCapabilitiesRequest() { + } + + /** + * Build call for getAuthCapabilities + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 auth capabilities -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getAuthCapabilitiesCall(_callback); + } + + /** + * Execute getAuthCapabilities request + * @return AuthCapabilities + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 auth capabilities -
0 Internal Server Error -
+ */ + public AuthCapabilities execute() throws ApiException { + ApiResponse localVarResp = getAuthCapabilitiesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getAuthCapabilities request with HTTP info returned + * @return ApiResponse<AuthCapabilities> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 auth capabilities -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getAuthCapabilitiesWithHttpInfo(); + } + + /** + * Execute getAuthCapabilities request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 auth capabilities -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getAuthCapabilitiesAsync(_callback); + } + } + + /** + * list authentication capabilities supported + * + * @return APIgetAuthCapabilitiesRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 auth capabilities -
0 Internal Server Error -
+ */ + public APIgetAuthCapabilitiesRequest getAuthCapabilities() { + return new APIgetAuthCapabilitiesRequest(); + } + private okhttp3.Call getSetupStateCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/setup_lakefs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSetupStateValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSetupStateCall(_callback); + + } + + + private ApiResponse getSetupStateWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSetupStateValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getSetupStateAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSetupStateValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetSetupStateRequest { + + private APIgetSetupStateRequest() { + } + + /** + * Build call for getSetupState + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS setup state -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getSetupStateCall(_callback); + } + + /** + * Execute getSetupState request + * @return SetupState + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS setup state -
0 Internal Server Error -
+ */ + public SetupState execute() throws ApiException { + ApiResponse localVarResp = getSetupStateWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getSetupState request with HTTP info returned + * @return ApiResponse<SetupState> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS setup state -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getSetupStateWithHttpInfo(); + } + + /** + * Execute getSetupState request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS setup state -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getSetupStateAsync(_callback); + } + } + + /** + * check if the lakeFS installation is already set up + * + * @return APIgetSetupStateRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 lakeFS setup state -
0 Internal Server Error -
+ */ + public APIgetSetupStateRequest getSetupState() { + return new APIgetSetupStateRequest(); + } + private okhttp3.Call postStatsEventsCall(StatsEventsList statsEventsList, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = statsEventsList; + + // create path and map variables + String localVarPath = "/statistics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postStatsEventsValidateBeforeCall(StatsEventsList statsEventsList, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'statsEventsList' is set + if (statsEventsList == null) { + throw new ApiException("Missing the required parameter 'statsEventsList' when calling postStatsEvents(Async)"); + } + + return postStatsEventsCall(statsEventsList, _callback); + + } + + + private ApiResponse postStatsEventsWithHttpInfo(StatsEventsList statsEventsList) throws ApiException { + okhttp3.Call localVarCall = postStatsEventsValidateBeforeCall(statsEventsList, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call postStatsEventsAsync(StatsEventsList statsEventsList, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postStatsEventsValidateBeforeCall(statsEventsList, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIpostStatsEventsRequest { + private final StatsEventsList statsEventsList; + + private APIpostStatsEventsRequest(StatsEventsList statsEventsList) { + this.statsEventsList = statsEventsList; + } + + /** + * Build call for postStatsEvents + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reported successfully -
400 Bad Request -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return postStatsEventsCall(statsEventsList, _callback); + } + + /** + * Execute postStatsEvents request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reported successfully -
400 Bad Request -
401 Unauthorized -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + postStatsEventsWithHttpInfo(statsEventsList); + } + + /** + * Execute postStatsEvents request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reported successfully -
400 Bad Request -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return postStatsEventsWithHttpInfo(statsEventsList); + } + + /** + * Execute postStatsEvents request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reported successfully -
400 Bad Request -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return postStatsEventsAsync(statsEventsList, _callback); + } + } + + /** + * post stats events, this endpoint is meant for internal use only + * + * @param statsEventsList (required) + * @return APIpostStatsEventsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 reported successfully -
400 Bad Request -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIpostStatsEventsRequest postStatsEvents(StatsEventsList statsEventsList) { + return new APIpostStatsEventsRequest(statsEventsList); + } + private okhttp3.Call setGarbageCollectionRulesPreflightCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/rules/set_allowed" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setGarbageCollectionRulesPreflightValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling setGarbageCollectionRulesPreflight(Async)"); + } + + return setGarbageCollectionRulesPreflightCall(repository, _callback); + + } + + + private ApiResponse setGarbageCollectionRulesPreflightWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = setGarbageCollectionRulesPreflightValidateBeforeCall(repository, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call setGarbageCollectionRulesPreflightAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setGarbageCollectionRulesPreflightValidateBeforeCall(repository, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIsetGarbageCollectionRulesPreflightRequest { + private final String repository; + + private APIsetGarbageCollectionRulesPreflightRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for setGarbageCollectionRulesPreflight + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 User has permissions to set garbage collection rules on this repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return setGarbageCollectionRulesPreflightCall(repository, _callback); + } + + /** + * Execute setGarbageCollectionRulesPreflight request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 User has permissions to set garbage collection rules on this repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + setGarbageCollectionRulesPreflightWithHttpInfo(repository); + } + + /** + * Execute setGarbageCollectionRulesPreflight request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 User has permissions to set garbage collection rules on this repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return setGarbageCollectionRulesPreflightWithHttpInfo(repository); + } + + /** + * Execute setGarbageCollectionRulesPreflight request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 User has permissions to set garbage collection rules on this repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return setGarbageCollectionRulesPreflightAsync(repository, _callback); + } + } + + /** + * + * + * @param repository (required) + * @return APIsetGarbageCollectionRulesPreflightRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 User has permissions to set garbage collection rules on this repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIsetGarbageCollectionRulesPreflightRequest setGarbageCollectionRulesPreflight(String repository) { + return new APIsetGarbageCollectionRulesPreflightRequest(repository); + } + private okhttp3.Call setupCall(Setup setup, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setup; + + // create path and map variables + String localVarPath = "/setup_lakefs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setupValidateBeforeCall(Setup setup, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setup' is set + if (setup == null) { + throw new ApiException("Missing the required parameter 'setup' when calling setup(Async)"); + } + + return setupCall(setup, _callback); + + } + + + private ApiResponse setupWithHttpInfo(Setup setup) throws ApiException { + okhttp3.Call localVarCall = setupValidateBeforeCall(setup, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call setupAsync(Setup setup, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setupValidateBeforeCall(setup, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIsetupRequest { + private final Setup setup; + + private APIsetupRequest(Setup setup) { + this.setup = setup; + } + + /** + * Build call for setup + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user created successfully -
400 Bad Request -
409 setup was already called -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return setupCall(setup, _callback); + } + + /** + * Execute setup request + * @return CredentialsWithSecret + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user created successfully -
400 Bad Request -
409 setup was already called -
0 Internal Server Error -
+ */ + public CredentialsWithSecret execute() throws ApiException { + ApiResponse localVarResp = setupWithHttpInfo(setup); + return localVarResp.getData(); + } + + /** + * Execute setup request with HTTP info returned + * @return ApiResponse<CredentialsWithSecret> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user created successfully -
400 Bad Request -
409 setup was already called -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return setupWithHttpInfo(setup); + } + + /** + * Execute setup request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user created successfully -
400 Bad Request -
409 setup was already called -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return setupAsync(setup, _callback); + } + } + + /** + * setup lakeFS and create a first user + * + * @param setup (required) + * @return APIsetupRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 user created successfully -
400 Bad Request -
409 setup was already called -
0 Internal Server Error -
+ */ + public APIsetupRequest setup(Setup setup) { + return new APIsetupRequest(setup); + } + private okhttp3.Call setupCommPrefsCall(CommPrefsInput commPrefsInput, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commPrefsInput; + + // create path and map variables + String localVarPath = "/setup_comm_prefs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setupCommPrefsValidateBeforeCall(CommPrefsInput commPrefsInput, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'commPrefsInput' is set + if (commPrefsInput == null) { + throw new ApiException("Missing the required parameter 'commPrefsInput' when calling setupCommPrefs(Async)"); + } + + return setupCommPrefsCall(commPrefsInput, _callback); + + } + + + private ApiResponse setupCommPrefsWithHttpInfo(CommPrefsInput commPrefsInput) throws ApiException { + okhttp3.Call localVarCall = setupCommPrefsValidateBeforeCall(commPrefsInput, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call setupCommPrefsAsync(CommPrefsInput commPrefsInput, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setupCommPrefsValidateBeforeCall(commPrefsInput, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIsetupCommPrefsRequest { + private final CommPrefsInput commPrefsInput; + + private APIsetupCommPrefsRequest(CommPrefsInput commPrefsInput) { + this.commPrefsInput = commPrefsInput; + } + + /** + * Build call for setupCommPrefs + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 communication preferences saved successfully -
409 setup was already completed -
412 wrong setup state for this operation -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return setupCommPrefsCall(commPrefsInput, _callback); + } + + /** + * Execute setupCommPrefs request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 communication preferences saved successfully -
409 setup was already completed -
412 wrong setup state for this operation -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + setupCommPrefsWithHttpInfo(commPrefsInput); + } + + /** + * Execute setupCommPrefs request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 communication preferences saved successfully -
409 setup was already completed -
412 wrong setup state for this operation -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return setupCommPrefsWithHttpInfo(commPrefsInput); + } + + /** + * Execute setupCommPrefs request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 communication preferences saved successfully -
409 setup was already completed -
412 wrong setup state for this operation -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return setupCommPrefsAsync(commPrefsInput, _callback); + } + } + + /** + * setup communications preferences + * + * @param commPrefsInput (required) + * @return APIsetupCommPrefsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 communication preferences saved successfully -
409 setup was already completed -
412 wrong setup state for this operation -
0 Internal Server Error -
+ */ + public APIsetupCommPrefsRequest setupCommPrefs(CommPrefsInput commPrefsInput) { + return new APIsetupCommPrefsRequest(commPrefsInput); + } + private okhttp3.Call uploadObjectPreflightCall(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects/stage_allowed" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadObjectPreflightValidateBeforeCall(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling uploadObjectPreflight(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling uploadObjectPreflight(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling uploadObjectPreflight(Async)"); + } + + return uploadObjectPreflightCall(repository, branch, path, _callback); + + } + + + private ApiResponse uploadObjectPreflightWithHttpInfo(String repository, String branch, String path) throws ApiException { + okhttp3.Call localVarCall = uploadObjectPreflightValidateBeforeCall(repository, branch, path, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call uploadObjectPreflightAsync(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadObjectPreflightValidateBeforeCall(repository, branch, path, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIuploadObjectPreflightRequest { + private final String repository; + private final String branch; + private final String path; + + private APIuploadObjectPreflightRequest(String repository, String branch, String path) { + this.repository = repository; + this.branch = branch; + this.path = path; + } + + /** + * Build call for uploadObjectPreflight + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return uploadObjectPreflightCall(repository, branch, path, _callback); + } + + /** + * Execute uploadObjectPreflight request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + uploadObjectPreflightWithHttpInfo(repository, branch, path); + } + + /** + * Execute uploadObjectPreflight request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return uploadObjectPreflightWithHttpInfo(repository, branch, path); + } + + /** + * Execute uploadObjectPreflight request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return uploadObjectPreflightAsync(repository, branch, path, _callback); + } + } + + /** + * + * + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @return APIuploadObjectPreflightRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 User has permissions to upload this object. This does not guarantee that the upload will be successful or even possible. It indicates only the permission at the time of calling this endpoint -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIuploadObjectPreflightRequest uploadObjectPreflight(String repository, String branch, String path) { + return new APIuploadObjectPreflightRequest(repository, branch, path); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java b/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java new file mode 100644 index 00000000000..ba1b0011bf7 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java @@ -0,0 +1,483 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ACL.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AccessKeyCredentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ActionRun.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ActionRunList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AuthCapabilities.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AuthenticationToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.BranchCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.BranchProtectionRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CherryPickCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommPrefsInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Commit.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Credentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CredentialsList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CredentialsWithSecret.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CurrentUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.DeleteBranchProtectionRuleRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Diff.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.DiffList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.DiffProperties.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Error.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ErrorNoACL.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.FindMergeBaseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GarbageCollectionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GarbageCollectionPrepareResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GarbageCollectionRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GarbageCollectionRules.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Group.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GroupCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.GroupList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.HookRun.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.HookRunList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ImportCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ImportCreationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ImportLocation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ImportStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.LoginConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.LoginInformation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Merge.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MergeResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MetaRangeCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MetaRangeCreationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.OTFDiffs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectCopyCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectErrorList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectStageCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ObjectStatsList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.OtfDiffEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.OtfDiffList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Pagination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PathList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Policy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PolicyList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PrepareGCUncommittedRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PrepareGCUncommittedResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RangeMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Ref.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RefList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RefsDump.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Repository.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RepositoryCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RepositoryList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ResetCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.RevertCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Setup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.SetupState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StagingLocation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StagingMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Statement.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StatsEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StatsEventsList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StorageConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.StorageURI.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.TagCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.UnderlyingObjectProperties.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.UpdateToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.UserCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.UserList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.VersionConfig.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/MetadataApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/MetadataApi.java new file mode 100644 index 00000000000..cff9fd249cb --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/MetadataApi.java @@ -0,0 +1,428 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.StorageURI; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MetadataApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MetadataApi() { + this(Configuration.getDefaultApiClient()); + } + + public MetadataApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call getMetaRangeCall(String repository, String metaRange, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/metadata/meta_range/{meta_range}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "meta_range" + "}", localVarApiClient.escapeString(metaRange.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMetaRangeValidateBeforeCall(String repository, String metaRange, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getMetaRange(Async)"); + } + + // verify the required parameter 'metaRange' is set + if (metaRange == null) { + throw new ApiException("Missing the required parameter 'metaRange' when calling getMetaRange(Async)"); + } + + return getMetaRangeCall(repository, metaRange, _callback); + + } + + + private ApiResponse getMetaRangeWithHttpInfo(String repository, String metaRange) throws ApiException { + okhttp3.Call localVarCall = getMetaRangeValidateBeforeCall(repository, metaRange, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getMetaRangeAsync(String repository, String metaRange, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMetaRangeValidateBeforeCall(repository, metaRange, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetMetaRangeRequest { + private final String repository; + private final String metaRange; + + private APIgetMetaRangeRequest(String repository, String metaRange) { + this.repository = repository; + this.metaRange = metaRange; + } + + /** + * Build call for getMetaRange + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 meta-range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getMetaRangeCall(repository, metaRange, _callback); + } + + /** + * Execute getMetaRange request + * @return StorageURI + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 meta-range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public StorageURI execute() throws ApiException { + ApiResponse localVarResp = getMetaRangeWithHttpInfo(repository, metaRange); + return localVarResp.getData(); + } + + /** + * Execute getMetaRange request with HTTP info returned + * @return ApiResponse<StorageURI> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 meta-range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getMetaRangeWithHttpInfo(repository, metaRange); + } + + /** + * Execute getMetaRange request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 meta-range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getMetaRangeAsync(repository, metaRange, _callback); + } + } + + /** + * return URI to a meta-range file + * + * @param repository (required) + * @param metaRange (required) + * @return APIgetMetaRangeRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 meta-range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetMetaRangeRequest getMetaRange(String repository, String metaRange) { + return new APIgetMetaRangeRequest(repository, metaRange); + } + private okhttp3.Call getRangeCall(String repository, String range, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/metadata/range/{range}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "range" + "}", localVarApiClient.escapeString(range.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRangeValidateBeforeCall(String repository, String range, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getRange(Async)"); + } + + // verify the required parameter 'range' is set + if (range == null) { + throw new ApiException("Missing the required parameter 'range' when calling getRange(Async)"); + } + + return getRangeCall(repository, range, _callback); + + } + + + private ApiResponse getRangeWithHttpInfo(String repository, String range) throws ApiException { + okhttp3.Call localVarCall = getRangeValidateBeforeCall(repository, range, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getRangeAsync(String repository, String range, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getRangeValidateBeforeCall(repository, range, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetRangeRequest { + private final String repository; + private final String range; + + private APIgetRangeRequest(String repository, String range) { + this.repository = repository; + this.range = range; + } + + /** + * Build call for getRange + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getRangeCall(repository, range, _callback); + } + + /** + * Execute getRange request + * @return StorageURI + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public StorageURI execute() throws ApiException { + ApiResponse localVarResp = getRangeWithHttpInfo(repository, range); + return localVarResp.getData(); + } + + /** + * Execute getRange request with HTTP info returned + * @return ApiResponse<StorageURI> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getRangeWithHttpInfo(repository, range); + } + + /** + * Execute getRange request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getRangeAsync(repository, range, _callback); + } + } + + /** + * return URI to a range file + * + * @param repository (required) + * @param range (required) + * @return APIgetRangeRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 range URI * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetRangeRequest getRange(String repository, String range) { + return new APIgetRangeRequest(repository, range); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ObjectsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ObjectsApi.java new file mode 100644 index 00000000000..e8b99a94148 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ObjectsApi.java @@ -0,0 +1,2255 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import java.io.File; +import io.lakefs.clients.sdk.model.ObjectCopyCreation; +import io.lakefs.clients.sdk.model.ObjectErrorList; +import io.lakefs.clients.sdk.model.ObjectStageCreation; +import io.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.ObjectStatsList; +import io.lakefs.clients.sdk.model.PathList; +import io.lakefs.clients.sdk.model.UnderlyingObjectProperties; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ObjectsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ObjectsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ObjectsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call copyObjectCall(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = objectCopyCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects/copy" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (destPath != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dest_path", destPath)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call copyObjectValidateBeforeCall(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling copyObject(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling copyObject(Async)"); + } + + // verify the required parameter 'destPath' is set + if (destPath == null) { + throw new ApiException("Missing the required parameter 'destPath' when calling copyObject(Async)"); + } + + // verify the required parameter 'objectCopyCreation' is set + if (objectCopyCreation == null) { + throw new ApiException("Missing the required parameter 'objectCopyCreation' when calling copyObject(Async)"); + } + + return copyObjectCall(repository, branch, destPath, objectCopyCreation, _callback); + + } + + + private ApiResponse copyObjectWithHttpInfo(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation) throws ApiException { + okhttp3.Call localVarCall = copyObjectValidateBeforeCall(repository, branch, destPath, objectCopyCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call copyObjectAsync(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = copyObjectValidateBeforeCall(repository, branch, destPath, objectCopyCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcopyObjectRequest { + private final String repository; + private final String branch; + private final String destPath; + private final ObjectCopyCreation objectCopyCreation; + + private APIcopyObjectRequest(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation) { + this.repository = repository; + this.branch = branch; + this.destPath = destPath; + this.objectCopyCreation = objectCopyCreation; + } + + /** + * Build call for copyObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Copy object response -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return copyObjectCall(repository, branch, destPath, objectCopyCreation, _callback); + } + + /** + * Execute copyObject request + * @return ObjectStats + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Copy object response -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = copyObjectWithHttpInfo(repository, branch, destPath, objectCopyCreation); + return localVarResp.getData(); + } + + /** + * Execute copyObject request with HTTP info returned + * @return ApiResponse<ObjectStats> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Copy object response -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return copyObjectWithHttpInfo(repository, branch, destPath, objectCopyCreation); + } + + /** + * Execute copyObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Copy object response -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return copyObjectAsync(repository, branch, destPath, objectCopyCreation, _callback); + } + } + + /** + * create a copy of an object + * + * @param repository (required) + * @param branch destination branch for the copy (required) + * @param destPath destination path relative to the branch (required) + * @param objectCopyCreation (required) + * @return APIcopyObjectRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Copy object response -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIcopyObjectRequest copyObject(String repository, String branch, String destPath, ObjectCopyCreation objectCopyCreation) { + return new APIcopyObjectRequest(repository, branch, destPath, objectCopyCreation); + } + private okhttp3.Call deleteObjectCall(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteObjectValidateBeforeCall(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteObject(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling deleteObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling deleteObject(Async)"); + } + + return deleteObjectCall(repository, branch, path, _callback); + + } + + + private ApiResponse deleteObjectWithHttpInfo(String repository, String branch, String path) throws ApiException { + okhttp3.Call localVarCall = deleteObjectValidateBeforeCall(repository, branch, path, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteObjectAsync(String repository, String branch, String path, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteObjectValidateBeforeCall(repository, branch, path, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteObjectRequest { + private final String repository; + private final String branch; + private final String path; + + private APIdeleteObjectRequest(String repository, String branch, String path) { + this.repository = repository; + this.branch = branch; + this.path = path; + } + + /** + * Build call for deleteObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 object deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteObjectCall(repository, branch, path, _callback); + } + + /** + * Execute deleteObject request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 object deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteObjectWithHttpInfo(repository, branch, path); + } + + /** + * Execute deleteObject request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 object deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteObjectWithHttpInfo(repository, branch, path); + } + + /** + * Execute deleteObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 object deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteObjectAsync(repository, branch, path, _callback); + } + } + + /** + * delete object. Missing objects will not return a NotFound error. + * + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @return APIdeleteObjectRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 object deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteObjectRequest deleteObject(String repository, String branch, String path) { + return new APIdeleteObjectRequest(repository, branch, path); + } + private okhttp3.Call deleteObjectsCall(String repository, String branch, PathList pathList, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = pathList; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects/delete" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteObjectsValidateBeforeCall(String repository, String branch, PathList pathList, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteObjects(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling deleteObjects(Async)"); + } + + // verify the required parameter 'pathList' is set + if (pathList == null) { + throw new ApiException("Missing the required parameter 'pathList' when calling deleteObjects(Async)"); + } + + return deleteObjectsCall(repository, branch, pathList, _callback); + + } + + + private ApiResponse deleteObjectsWithHttpInfo(String repository, String branch, PathList pathList) throws ApiException { + okhttp3.Call localVarCall = deleteObjectsValidateBeforeCall(repository, branch, pathList, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call deleteObjectsAsync(String repository, String branch, PathList pathList, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteObjectsValidateBeforeCall(repository, branch, pathList, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIdeleteObjectsRequest { + private final String repository; + private final String branch; + private final PathList pathList; + + private APIdeleteObjectsRequest(String repository, String branch, PathList pathList) { + this.repository = repository; + this.branch = branch; + this.pathList = pathList; + } + + /** + * Build call for deleteObjects + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Delete objects response -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteObjectsCall(repository, branch, pathList, _callback); + } + + /** + * Execute deleteObjects request + * @return ObjectErrorList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Delete objects response -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ObjectErrorList execute() throws ApiException { + ApiResponse localVarResp = deleteObjectsWithHttpInfo(repository, branch, pathList); + return localVarResp.getData(); + } + + /** + * Execute deleteObjects request with HTTP info returned + * @return ApiResponse<ObjectErrorList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Delete objects response -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteObjectsWithHttpInfo(repository, branch, pathList); + } + + /** + * Execute deleteObjects request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Delete objects response -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteObjectsAsync(repository, branch, pathList, _callback); + } + } + + /** + * delete objects. Missing objects will not return a NotFound error. + * + * @param repository (required) + * @param branch (required) + * @param pathList (required) + * @return APIdeleteObjectsRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Delete objects response -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteObjectsRequest deleteObjects(String repository, String branch, PathList pathList) { + return new APIdeleteObjectsRequest(repository, branch, pathList); + } + private okhttp3.Call getObjectCall(String repository, String ref, String path, String range, Boolean presign, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/objects" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (presign != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("presign", presign)); + } + + if (range != null) { + localVarHeaderParams.put("Range", localVarApiClient.parameterToString(range)); + } + + final String[] localVarAccepts = { + "application/octet-stream", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getObjectValidateBeforeCall(String repository, String ref, String path, String range, Boolean presign, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getObject(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling getObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling getObject(Async)"); + } + + return getObjectCall(repository, ref, path, range, presign, _callback); + + } + + + private ApiResponse getObjectWithHttpInfo(String repository, String ref, String path, String range, Boolean presign) throws ApiException { + okhttp3.Call localVarCall = getObjectValidateBeforeCall(repository, ref, path, range, presign, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getObjectAsync(String repository, String ref, String path, String range, Boolean presign, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getObjectValidateBeforeCall(repository, ref, path, range, presign, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetObjectRequest { + private final String repository; + private final String ref; + private final String path; + private String range; + private Boolean presign; + + private APIgetObjectRequest(String repository, String ref, String path) { + this.repository = repository; + this.ref = ref; + this.path = path; + } + + /** + * Set range + * @param range Byte range to retrieve (optional) + * @return APIgetObjectRequest + */ + public APIgetObjectRequest range(String range) { + this.range = range; + return this; + } + + /** + * Set presign + * @param presign (optional) + * @return APIgetObjectRequest + */ + public APIgetObjectRequest presign(Boolean presign) { + this.presign = presign; + return this; + } + + /** + * Build call for getObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getObjectCall(repository, ref, path, range, presign, _callback); + } + + /** + * Execute getObject request + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
0 Internal Server Error -
+ */ + public File execute() throws ApiException { + ApiResponse localVarResp = getObjectWithHttpInfo(repository, ref, path, range, presign); + return localVarResp.getData(); + } + + /** + * Execute getObject request with HTTP info returned + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getObjectWithHttpInfo(repository, ref, path, range, presign); + } + + /** + * Execute getObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getObjectAsync(repository, ref, path, range, presign, _callback); + } + } + + /** + * get object content + * + * @param repository (required) + * @param ref a reference (could be either a branch or a commit ID) (required) + * @param path relative to the ref (required) + * @return APIgetObjectRequest + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
0 Internal Server Error -
+ */ + public APIgetObjectRequest getObject(String repository, String ref, String path) { + return new APIgetObjectRequest(repository, ref, path); + } + private okhttp3.Call getUnderlyingPropertiesCall(String repository, String ref, String path, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/objects/underlyingProperties" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUnderlyingPropertiesValidateBeforeCall(String repository, String ref, String path, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getUnderlyingProperties(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling getUnderlyingProperties(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling getUnderlyingProperties(Async)"); + } + + return getUnderlyingPropertiesCall(repository, ref, path, _callback); + + } + + + private ApiResponse getUnderlyingPropertiesWithHttpInfo(String repository, String ref, String path) throws ApiException { + okhttp3.Call localVarCall = getUnderlyingPropertiesValidateBeforeCall(repository, ref, path, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getUnderlyingPropertiesAsync(String repository, String ref, String path, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUnderlyingPropertiesValidateBeforeCall(repository, ref, path, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetUnderlyingPropertiesRequest { + private final String repository; + private final String ref; + private final String path; + + private APIgetUnderlyingPropertiesRequest(String repository, String ref, String path) { + this.repository = repository; + this.ref = ref; + this.path = path; + } + + /** + * Build call for getUnderlyingProperties + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object metadata on underlying storage -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getUnderlyingPropertiesCall(repository, ref, path, _callback); + } + + /** + * Execute getUnderlyingProperties request + * @return UnderlyingObjectProperties + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object metadata on underlying storage -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public UnderlyingObjectProperties execute() throws ApiException { + ApiResponse localVarResp = getUnderlyingPropertiesWithHttpInfo(repository, ref, path); + return localVarResp.getData(); + } + + /** + * Execute getUnderlyingProperties request with HTTP info returned + * @return ApiResponse<UnderlyingObjectProperties> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object metadata on underlying storage -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getUnderlyingPropertiesWithHttpInfo(repository, ref, path); + } + + /** + * Execute getUnderlyingProperties request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object metadata on underlying storage -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getUnderlyingPropertiesAsync(repository, ref, path, _callback); + } + } + + /** + * get object properties on underlying storage + * + * @param repository (required) + * @param ref a reference (could be either a branch or a commit ID) (required) + * @param path relative to the branch (required) + * @return APIgetUnderlyingPropertiesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object metadata on underlying storage -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetUnderlyingPropertiesRequest getUnderlyingProperties(String repository, String ref, String path) { + return new APIgetUnderlyingPropertiesRequest(repository, ref, path); + } + private okhttp3.Call headObjectCall(String repository, String ref, String path, String range, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/objects" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (range != null) { + localVarHeaderParams.put("Range", localVarApiClient.parameterToString(range)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "HEAD", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call headObjectValidateBeforeCall(String repository, String ref, String path, String range, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling headObject(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling headObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling headObject(Async)"); + } + + return headObjectCall(repository, ref, path, range, _callback); + + } + + + private ApiResponse headObjectWithHttpInfo(String repository, String ref, String path, String range) throws ApiException { + okhttp3.Call localVarCall = headObjectValidateBeforeCall(repository, ref, path, range, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call headObjectAsync(String repository, String ref, String path, String range, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = headObjectValidateBeforeCall(repository, ref, path, range, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIheadObjectRequest { + private final String repository; + private final String ref; + private final String path; + private String range; + + private APIheadObjectRequest(String repository, String ref, String path) { + this.repository = repository; + this.ref = ref; + this.path = path; + } + + /** + * Set range + * @param range Byte range to retrieve (optional) + * @return APIheadObjectRequest + */ + public APIheadObjectRequest range(String range) { + this.range = range; + return this; + } + + /** + * Build call for headObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
0 internal server error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return headObjectCall(repository, ref, path, range, _callback); + } + + /** + * Execute headObject request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
0 internal server error -
+ */ + public void execute() throws ApiException { + headObjectWithHttpInfo(repository, ref, path, range); + } + + /** + * Execute headObject request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
0 internal server error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return headObjectWithHttpInfo(repository, ref, path, range); + } + + /** + * Execute headObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
0 internal server error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return headObjectAsync(repository, ref, path, range, _callback); + } + } + + /** + * check if object exists + * + * @param repository (required) + * @param ref a reference (could be either a branch or a commit ID) (required) + * @param path relative to the ref (required) + * @return APIheadObjectRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
0 internal server error -
+ */ + public APIheadObjectRequest headObject(String repository, String ref, String path) { + return new APIheadObjectRequest(repository, ref, path); + } + private okhttp3.Call listObjectsCall(String repository, String ref, Boolean userMetadata, Boolean presign, String after, Integer amount, String delimiter, String prefix, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/objects/ls" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userMetadata != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_metadata", userMetadata)); + } + + if (presign != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("presign", presign)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (delimiter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delimiter", delimiter)); + } + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listObjectsValidateBeforeCall(String repository, String ref, Boolean userMetadata, Boolean presign, String after, Integer amount, String delimiter, String prefix, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling listObjects(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling listObjects(Async)"); + } + + return listObjectsCall(repository, ref, userMetadata, presign, after, amount, delimiter, prefix, _callback); + + } + + + private ApiResponse listObjectsWithHttpInfo(String repository, String ref, Boolean userMetadata, Boolean presign, String after, Integer amount, String delimiter, String prefix) throws ApiException { + okhttp3.Call localVarCall = listObjectsValidateBeforeCall(repository, ref, userMetadata, presign, after, amount, delimiter, prefix, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listObjectsAsync(String repository, String ref, Boolean userMetadata, Boolean presign, String after, Integer amount, String delimiter, String prefix, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listObjectsValidateBeforeCall(repository, ref, userMetadata, presign, after, amount, delimiter, prefix, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistObjectsRequest { + private final String repository; + private final String ref; + private Boolean userMetadata; + private Boolean presign; + private String after; + private Integer amount; + private String delimiter; + private String prefix; + + private APIlistObjectsRequest(String repository, String ref) { + this.repository = repository; + this.ref = ref; + } + + /** + * Set userMetadata + * @param userMetadata (optional, default to true) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest userMetadata(Boolean userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + /** + * Set presign + * @param presign (optional) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest presign(Boolean presign) { + this.presign = presign; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set delimiter + * @param delimiter delimiter used to group common prefixes by (optional) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest delimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistObjectsRequest + */ + public APIlistObjectsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Build call for listObjects + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object listing -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listObjectsCall(repository, ref, userMetadata, presign, after, amount, delimiter, prefix, _callback); + } + + /** + * Execute listObjects request + * @return ObjectStatsList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object listing -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ObjectStatsList execute() throws ApiException { + ApiResponse localVarResp = listObjectsWithHttpInfo(repository, ref, userMetadata, presign, after, amount, delimiter, prefix); + return localVarResp.getData(); + } + + /** + * Execute listObjects request with HTTP info returned + * @return ApiResponse<ObjectStatsList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object listing -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listObjectsWithHttpInfo(repository, ref, userMetadata, presign, after, amount, delimiter, prefix); + } + + /** + * Execute listObjects request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object listing -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listObjectsAsync(repository, ref, userMetadata, presign, after, amount, delimiter, prefix, _callback); + } + } + + /** + * list objects under a given prefix + * + * @param repository (required) + * @param ref a reference (could be either a branch or a commit ID) (required) + * @return APIlistObjectsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 object listing -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistObjectsRequest listObjects(String repository, String ref) { + return new APIlistObjectsRequest(repository, ref); + } + private okhttp3.Call stageObjectCall(String repository, String branch, String path, ObjectStageCreation objectStageCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = objectStageCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call stageObjectValidateBeforeCall(String repository, String branch, String path, ObjectStageCreation objectStageCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling stageObject(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling stageObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling stageObject(Async)"); + } + + // verify the required parameter 'objectStageCreation' is set + if (objectStageCreation == null) { + throw new ApiException("Missing the required parameter 'objectStageCreation' when calling stageObject(Async)"); + } + + return stageObjectCall(repository, branch, path, objectStageCreation, _callback); + + } + + + private ApiResponse stageObjectWithHttpInfo(String repository, String branch, String path, ObjectStageCreation objectStageCreation) throws ApiException { + okhttp3.Call localVarCall = stageObjectValidateBeforeCall(repository, branch, path, objectStageCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call stageObjectAsync(String repository, String branch, String path, ObjectStageCreation objectStageCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = stageObjectValidateBeforeCall(repository, branch, path, objectStageCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIstageObjectRequest { + private final String repository; + private final String branch; + private final String path; + private final ObjectStageCreation objectStageCreation; + + private APIstageObjectRequest(String repository, String branch, String path, ObjectStageCreation objectStageCreation) { + this.repository = repository; + this.branch = branch; + this.path = path; + this.objectStageCreation = objectStageCreation; + } + + /** + * Build call for stageObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return stageObjectCall(repository, branch, path, objectStageCreation, _callback); + } + + /** + * Execute stageObject request + * @return ObjectStats + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = stageObjectWithHttpInfo(repository, branch, path, objectStageCreation); + return localVarResp.getData(); + } + + /** + * Execute stageObject request with HTTP info returned + * @return ApiResponse<ObjectStats> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return stageObjectWithHttpInfo(repository, branch, path, objectStageCreation); + } + + /** + * Execute stageObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return stageObjectAsync(repository, branch, path, objectStageCreation, _callback); + } + } + + /** + * stage an object's metadata for the given branch + * + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @param objectStageCreation (required) + * @return APIstageObjectRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIstageObjectRequest stageObject(String repository, String branch, String path, ObjectStageCreation objectStageCreation) { + return new APIstageObjectRequest(repository, branch, path, objectStageCreation); + } + private okhttp3.Call statObjectCall(String repository, String ref, String path, Boolean userMetadata, Boolean presign, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/objects/stat" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (userMetadata != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_metadata", userMetadata)); + } + + if (presign != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("presign", presign)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call statObjectValidateBeforeCall(String repository, String ref, String path, Boolean userMetadata, Boolean presign, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling statObject(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling statObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling statObject(Async)"); + } + + return statObjectCall(repository, ref, path, userMetadata, presign, _callback); + + } + + + private ApiResponse statObjectWithHttpInfo(String repository, String ref, String path, Boolean userMetadata, Boolean presign) throws ApiException { + okhttp3.Call localVarCall = statObjectValidateBeforeCall(repository, ref, path, userMetadata, presign, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call statObjectAsync(String repository, String ref, String path, Boolean userMetadata, Boolean presign, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = statObjectValidateBeforeCall(repository, ref, path, userMetadata, presign, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIstatObjectRequest { + private final String repository; + private final String ref; + private final String path; + private Boolean userMetadata; + private Boolean presign; + + private APIstatObjectRequest(String repository, String ref, String path) { + this.repository = repository; + this.ref = ref; + this.path = path; + } + + /** + * Set userMetadata + * @param userMetadata (optional, default to true) + * @return APIstatObjectRequest + */ + public APIstatObjectRequest userMetadata(Boolean userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + /** + * Set presign + * @param presign (optional) + * @return APIstatObjectRequest + */ + public APIstatObjectRequest presign(Boolean presign) { + this.presign = presign; + return this; + } + + /** + * Build call for statObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return statObjectCall(repository, ref, path, userMetadata, presign, _callback); + } + + /** + * Execute statObject request + * @return ObjectStats + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
0 Internal Server Error -
+ */ + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = statObjectWithHttpInfo(repository, ref, path, userMetadata, presign); + return localVarResp.getData(); + } + + /** + * Execute statObject request with HTTP info returned + * @return ApiResponse<ObjectStats> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return statObjectWithHttpInfo(repository, ref, path, userMetadata, presign); + } + + /** + * Execute statObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return statObjectAsync(repository, ref, path, userMetadata, presign, _callback); + } + } + + /** + * get object metadata + * + * @param repository (required) + * @param ref a reference (could be either a branch or a commit ID) (required) + * @param path relative to the branch (required) + * @return APIstatObjectRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
0 Internal Server Error -
+ */ + public APIstatObjectRequest statObject(String repository, String ref, String path) { + return new APIstatObjectRequest(repository, ref, path); + } + private okhttp3.Call uploadObjectCall(String repository, String branch, String path, String storageClass, String ifNoneMatch, File content, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/objects" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (content != null) { + localVarFormParams.put("content", content); + } + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (storageClass != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("storageClass", storageClass)); + } + + if (ifNoneMatch != null) { + localVarHeaderParams.put("If-None-Match", localVarApiClient.parameterToString(ifNoneMatch)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data", + "application/octet-stream" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadObjectValidateBeforeCall(String repository, String branch, String path, String storageClass, String ifNoneMatch, File content, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling uploadObject(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling uploadObject(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling uploadObject(Async)"); + } + + return uploadObjectCall(repository, branch, path, storageClass, ifNoneMatch, content, _callback); + + } + + + private ApiResponse uploadObjectWithHttpInfo(String repository, String branch, String path, String storageClass, String ifNoneMatch, File content) throws ApiException { + okhttp3.Call localVarCall = uploadObjectValidateBeforeCall(repository, branch, path, storageClass, ifNoneMatch, content, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call uploadObjectAsync(String repository, String branch, String path, String storageClass, String ifNoneMatch, File content, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadObjectValidateBeforeCall(repository, branch, path, storageClass, ifNoneMatch, content, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIuploadObjectRequest { + private final String repository; + private final String branch; + private final String path; + private String storageClass; + private String ifNoneMatch; + private File content; + + private APIuploadObjectRequest(String repository, String branch, String path) { + this.repository = repository; + this.branch = branch; + this.path = path; + } + + /** + * Set storageClass + * @param storageClass (optional) + * @return APIuploadObjectRequest + */ + public APIuploadObjectRequest storageClass(String storageClass) { + this.storageClass = storageClass; + return this; + } + + /** + * Set ifNoneMatch + * @param ifNoneMatch Currently supports only \"*\" to allow uploading an object only if one doesn't exist yet (optional) + * @return APIuploadObjectRequest + */ + public APIuploadObjectRequest ifNoneMatch(String ifNoneMatch) { + this.ifNoneMatch = ifNoneMatch; + return this; + } + + /** + * Set content + * @param content Only a single file per upload which must be named \\\"content\\\". (optional) + * @return APIuploadObjectRequest + */ + public APIuploadObjectRequest content(File content) { + this.content = content; + return this; + } + + /** + * Build call for uploadObject + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return uploadObjectCall(repository, branch, path, storageClass, ifNoneMatch, content, _callback); + } + + /** + * Execute uploadObject request + * @return ObjectStats + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = uploadObjectWithHttpInfo(repository, branch, path, storageClass, ifNoneMatch, content); + return localVarResp.getData(); + } + + /** + * Execute uploadObject request with HTTP info returned + * @return ApiResponse<ObjectStats> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return uploadObjectWithHttpInfo(repository, branch, path, storageClass, ifNoneMatch, content); + } + + /** + * Execute uploadObject request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return uploadObjectAsync(repository, branch, path, storageClass, ifNoneMatch, content, _callback); + } + } + + /** + * + * + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @return APIuploadObjectRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
0 Internal Server Error -
+ */ + public APIuploadObjectRequest uploadObject(String repository, String branch, String path) { + return new APIuploadObjectRequest(repository, branch, path); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java b/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java new file mode 100644 index 00000000000..5e2cb4c7376 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java @@ -0,0 +1,57 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressRequestBody.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressRequestBody.java new file mode 100644 index 00000000000..1b157bbd717 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressResponseBody.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressResponseBody.java new file mode 100644 index 00000000000..b3b0f40c01f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java new file mode 100644 index 00000000000..823730ad661 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java @@ -0,0 +1,1363 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.CommitList; +import io.lakefs.clients.sdk.model.DiffList; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.FindMergeBaseResult; +import io.lakefs.clients.sdk.model.Merge; +import io.lakefs.clients.sdk.model.MergeResult; +import io.lakefs.clients.sdk.model.RefsDump; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RefsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RefsApi() { + this(Configuration.getDefaultApiClient()); + } + + public RefsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call diffRefsCall(String repository, String leftRef, String rightRef, String after, Integer amount, String prefix, String delimiter, String type, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{leftRef}/diff/{rightRef}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "leftRef" + "}", localVarApiClient.escapeString(leftRef.toString())) + .replace("{" + "rightRef" + "}", localVarApiClient.escapeString(rightRef.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (delimiter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delimiter", delimiter)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call diffRefsValidateBeforeCall(String repository, String leftRef, String rightRef, String after, Integer amount, String prefix, String delimiter, String type, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling diffRefs(Async)"); + } + + // verify the required parameter 'leftRef' is set + if (leftRef == null) { + throw new ApiException("Missing the required parameter 'leftRef' when calling diffRefs(Async)"); + } + + // verify the required parameter 'rightRef' is set + if (rightRef == null) { + throw new ApiException("Missing the required parameter 'rightRef' when calling diffRefs(Async)"); + } + + return diffRefsCall(repository, leftRef, rightRef, after, amount, prefix, delimiter, type, _callback); + + } + + + private ApiResponse diffRefsWithHttpInfo(String repository, String leftRef, String rightRef, String after, Integer amount, String prefix, String delimiter, String type) throws ApiException { + okhttp3.Call localVarCall = diffRefsValidateBeforeCall(repository, leftRef, rightRef, after, amount, prefix, delimiter, type, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call diffRefsAsync(String repository, String leftRef, String rightRef, String after, Integer amount, String prefix, String delimiter, String type, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = diffRefsValidateBeforeCall(repository, leftRef, rightRef, after, amount, prefix, delimiter, type, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIdiffRefsRequest { + private final String repository; + private final String leftRef; + private final String rightRef; + private String after; + private Integer amount; + private String prefix; + private String delimiter; + private String type; + + private APIdiffRefsRequest(String repository, String leftRef, String rightRef) { + this.repository = repository; + this.leftRef = leftRef; + this.rightRef = rightRef; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIdiffRefsRequest + */ + public APIdiffRefsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIdiffRefsRequest + */ + public APIdiffRefsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIdiffRefsRequest + */ + public APIdiffRefsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set delimiter + * @param delimiter delimiter used to group common prefixes by (optional) + * @return APIdiffRefsRequest + */ + public APIdiffRefsRequest delimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Set type + * @param type (optional, default to three_dot) + * @return APIdiffRefsRequest + */ + public APIdiffRefsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for diffRefs + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff between refs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return diffRefsCall(repository, leftRef, rightRef, after, amount, prefix, delimiter, type, _callback); + } + + /** + * Execute diffRefs request + * @return DiffList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff between refs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public DiffList execute() throws ApiException { + ApiResponse localVarResp = diffRefsWithHttpInfo(repository, leftRef, rightRef, after, amount, prefix, delimiter, type); + return localVarResp.getData(); + } + + /** + * Execute diffRefs request with HTTP info returned + * @return ApiResponse<DiffList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff between refs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return diffRefsWithHttpInfo(repository, leftRef, rightRef, after, amount, prefix, delimiter, type); + } + + /** + * Execute diffRefs request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff between refs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return diffRefsAsync(repository, leftRef, rightRef, after, amount, prefix, delimiter, type, _callback); + } + } + + /** + * diff references + * + * @param repository (required) + * @param leftRef a reference (could be either a branch or a commit ID) (required) + * @param rightRef a reference (could be either a branch or a commit ID) to compare against (required) + * @return APIdiffRefsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 diff between refs -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdiffRefsRequest diffRefs(String repository, String leftRef, String rightRef) { + return new APIdiffRefsRequest(repository, leftRef, rightRef); + } + private okhttp3.Call dumpRefsCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/dump" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call dumpRefsValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling dumpRefs(Async)"); + } + + return dumpRefsCall(repository, _callback); + + } + + + private ApiResponse dumpRefsWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = dumpRefsValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call dumpRefsAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = dumpRefsValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIdumpRefsRequest { + private final String repository; + + private APIdumpRefsRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for dumpRefs + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 refs dump -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return dumpRefsCall(repository, _callback); + } + + /** + * Execute dumpRefs request + * @return RefsDump + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 refs dump -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public RefsDump execute() throws ApiException { + ApiResponse localVarResp = dumpRefsWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute dumpRefs request with HTTP info returned + * @return ApiResponse<RefsDump> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 refs dump -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return dumpRefsWithHttpInfo(repository); + } + + /** + * Execute dumpRefs request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 refs dump -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return dumpRefsAsync(repository, _callback); + } + } + + /** + * Dump repository refs (tags, commits, branches) to object store + * + * @param repository (required) + * @return APIdumpRefsRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 refs dump -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdumpRefsRequest dumpRefs(String repository) { + return new APIdumpRefsRequest(repository); + } + private okhttp3.Call findMergeBaseCall(String repository, String sourceRef, String destinationBranch, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "sourceRef" + "}", localVarApiClient.escapeString(sourceRef.toString())) + .replace("{" + "destinationBranch" + "}", localVarApiClient.escapeString(destinationBranch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call findMergeBaseValidateBeforeCall(String repository, String sourceRef, String destinationBranch, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling findMergeBase(Async)"); + } + + // verify the required parameter 'sourceRef' is set + if (sourceRef == null) { + throw new ApiException("Missing the required parameter 'sourceRef' when calling findMergeBase(Async)"); + } + + // verify the required parameter 'destinationBranch' is set + if (destinationBranch == null) { + throw new ApiException("Missing the required parameter 'destinationBranch' when calling findMergeBase(Async)"); + } + + return findMergeBaseCall(repository, sourceRef, destinationBranch, _callback); + + } + + + private ApiResponse findMergeBaseWithHttpInfo(String repository, String sourceRef, String destinationBranch) throws ApiException { + okhttp3.Call localVarCall = findMergeBaseValidateBeforeCall(repository, sourceRef, destinationBranch, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call findMergeBaseAsync(String repository, String sourceRef, String destinationBranch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = findMergeBaseValidateBeforeCall(repository, sourceRef, destinationBranch, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIfindMergeBaseRequest { + private final String repository; + private final String sourceRef; + private final String destinationBranch; + + private APIfindMergeBaseRequest(String repository, String sourceRef, String destinationBranch) { + this.repository = repository; + this.sourceRef = sourceRef; + this.destinationBranch = destinationBranch; + } + + /** + * Build call for findMergeBase + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Found the merge base -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return findMergeBaseCall(repository, sourceRef, destinationBranch, _callback); + } + + /** + * Execute findMergeBase request + * @return FindMergeBaseResult + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Found the merge base -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public FindMergeBaseResult execute() throws ApiException { + ApiResponse localVarResp = findMergeBaseWithHttpInfo(repository, sourceRef, destinationBranch); + return localVarResp.getData(); + } + + /** + * Execute findMergeBase request with HTTP info returned + * @return ApiResponse<FindMergeBaseResult> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Found the merge base -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return findMergeBaseWithHttpInfo(repository, sourceRef, destinationBranch); + } + + /** + * Execute findMergeBase request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Found the merge base -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return findMergeBaseAsync(repository, sourceRef, destinationBranch, _callback); + } + } + + /** + * find the merge base for 2 references + * + * @param repository (required) + * @param sourceRef source ref (required) + * @param destinationBranch destination branch name (required) + * @return APIfindMergeBaseRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Found the merge base -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIfindMergeBaseRequest findMergeBase(String repository, String sourceRef, String destinationBranch) { + return new APIfindMergeBaseRequest(repository, sourceRef, destinationBranch); + } + private okhttp3.Call logCommitsCall(String repository, String ref, String after, Integer amount, List objects, List prefixes, Boolean limit, Boolean firstParent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{ref}/commits" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "ref" + "}", localVarApiClient.escapeString(ref.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (objects != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "objects", objects)); + } + + if (prefixes != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prefixes", prefixes)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (firstParent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("first_parent", firstParent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call logCommitsValidateBeforeCall(String repository, String ref, String after, Integer amount, List objects, List prefixes, Boolean limit, Boolean firstParent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling logCommits(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling logCommits(Async)"); + } + + return logCommitsCall(repository, ref, after, amount, objects, prefixes, limit, firstParent, _callback); + + } + + + private ApiResponse logCommitsWithHttpInfo(String repository, String ref, String after, Integer amount, List objects, List prefixes, Boolean limit, Boolean firstParent) throws ApiException { + okhttp3.Call localVarCall = logCommitsValidateBeforeCall(repository, ref, after, amount, objects, prefixes, limit, firstParent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call logCommitsAsync(String repository, String ref, String after, Integer amount, List objects, List prefixes, Boolean limit, Boolean firstParent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = logCommitsValidateBeforeCall(repository, ref, after, amount, objects, prefixes, limit, firstParent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlogCommitsRequest { + private final String repository; + private final String ref; + private String after; + private Integer amount; + private List objects; + private List prefixes; + private Boolean limit; + private Boolean firstParent; + + private APIlogCommitsRequest(String repository, String ref) { + this.repository = repository; + this.ref = ref; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set objects + * @param objects list of paths, each element is a path of a specific object (optional) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest objects(List objects) { + this.objects = objects; + return this; + } + + /** + * Set prefixes + * @param prefixes list of paths, each element is a path of a prefix (optional) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest prefixes(List prefixes) { + this.prefixes = prefixes; + return this; + } + + /** + * Set limit + * @param limit limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest limit(Boolean limit) { + this.limit = limit; + return this; + } + + /** + * Set firstParent + * @param firstParent if set to true, follow only the first parent upon reaching a merge commit (optional) + * @return APIlogCommitsRequest + */ + public APIlogCommitsRequest firstParent(Boolean firstParent) { + this.firstParent = firstParent; + return this; + } + + /** + * Build call for logCommits + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit log -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return logCommitsCall(repository, ref, after, amount, objects, prefixes, limit, firstParent, _callback); + } + + /** + * Execute logCommits request + * @return CommitList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit log -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public CommitList execute() throws ApiException { + ApiResponse localVarResp = logCommitsWithHttpInfo(repository, ref, after, amount, objects, prefixes, limit, firstParent); + return localVarResp.getData(); + } + + /** + * Execute logCommits request with HTTP info returned + * @return ApiResponse<CommitList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit log -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return logCommitsWithHttpInfo(repository, ref, after, amount, objects, prefixes, limit, firstParent); + } + + /** + * Execute logCommits request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit log -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return logCommitsAsync(repository, ref, after, amount, objects, prefixes, limit, firstParent, _callback); + } + } + + /** + * get commit log from ref. If both objects and prefixes are empty, return all commits. + * + * @param repository (required) + * @param ref (required) + * @return APIlogCommitsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 commit log -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlogCommitsRequest logCommits(String repository, String ref) { + return new APIlogCommitsRequest(repository, ref); + } + private okhttp3.Call mergeIntoBranchCall(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = merge; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "sourceRef" + "}", localVarApiClient.escapeString(sourceRef.toString())) + .replace("{" + "destinationBranch" + "}", localVarApiClient.escapeString(destinationBranch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mergeIntoBranchValidateBeforeCall(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling mergeIntoBranch(Async)"); + } + + // verify the required parameter 'sourceRef' is set + if (sourceRef == null) { + throw new ApiException("Missing the required parameter 'sourceRef' when calling mergeIntoBranch(Async)"); + } + + // verify the required parameter 'destinationBranch' is set + if (destinationBranch == null) { + throw new ApiException("Missing the required parameter 'destinationBranch' when calling mergeIntoBranch(Async)"); + } + + return mergeIntoBranchCall(repository, sourceRef, destinationBranch, merge, _callback); + + } + + + private ApiResponse mergeIntoBranchWithHttpInfo(String repository, String sourceRef, String destinationBranch, Merge merge) throws ApiException { + okhttp3.Call localVarCall = mergeIntoBranchValidateBeforeCall(repository, sourceRef, destinationBranch, merge, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call mergeIntoBranchAsync(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = mergeIntoBranchValidateBeforeCall(repository, sourceRef, destinationBranch, merge, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APImergeIntoBranchRequest { + private final String repository; + private final String sourceRef; + private final String destinationBranch; + private Merge merge; + + private APImergeIntoBranchRequest(String repository, String sourceRef, String destinationBranch) { + this.repository = repository; + this.sourceRef = sourceRef; + this.destinationBranch = destinationBranch; + } + + /** + * Set merge + * @param merge (optional) + * @return APImergeIntoBranchRequest + */ + public APImergeIntoBranchRequest merge(Merge merge) { + this.merge = merge; + return this; + } + + /** + * Build call for mergeIntoBranch + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 merge completed -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult -
412 precondition failed (e.g. a pre-merge hook returned a failure) -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return mergeIntoBranchCall(repository, sourceRef, destinationBranch, merge, _callback); + } + + /** + * Execute mergeIntoBranch request + * @return MergeResult + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 merge completed -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult -
412 precondition failed (e.g. a pre-merge hook returned a failure) -
0 Internal Server Error -
+ */ + public MergeResult execute() throws ApiException { + ApiResponse localVarResp = mergeIntoBranchWithHttpInfo(repository, sourceRef, destinationBranch, merge); + return localVarResp.getData(); + } + + /** + * Execute mergeIntoBranch request with HTTP info returned + * @return ApiResponse<MergeResult> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 merge completed -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult -
412 precondition failed (e.g. a pre-merge hook returned a failure) -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return mergeIntoBranchWithHttpInfo(repository, sourceRef, destinationBranch, merge); + } + + /** + * Execute mergeIntoBranch request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 merge completed -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult -
412 precondition failed (e.g. a pre-merge hook returned a failure) -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return mergeIntoBranchAsync(repository, sourceRef, destinationBranch, merge, _callback); + } + } + + /** + * merge references + * + * @param repository (required) + * @param sourceRef source ref (required) + * @param destinationBranch destination branch name (required) + * @return APImergeIntoBranchRequest + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 merge completed -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult -
412 precondition failed (e.g. a pre-merge hook returned a failure) -
0 Internal Server Error -
+ */ + public APImergeIntoBranchRequest mergeIntoBranch(String repository, String sourceRef, String destinationBranch) { + return new APImergeIntoBranchRequest(repository, sourceRef, destinationBranch); + } + private okhttp3.Call restoreRefsCall(String repository, RefsDump refsDump, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = refsDump; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/restore" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreRefsValidateBeforeCall(String repository, RefsDump refsDump, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling restoreRefs(Async)"); + } + + // verify the required parameter 'refsDump' is set + if (refsDump == null) { + throw new ApiException("Missing the required parameter 'refsDump' when calling restoreRefs(Async)"); + } + + return restoreRefsCall(repository, refsDump, _callback); + + } + + + private ApiResponse restoreRefsWithHttpInfo(String repository, RefsDump refsDump) throws ApiException { + okhttp3.Call localVarCall = restoreRefsValidateBeforeCall(repository, refsDump, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call restoreRefsAsync(String repository, RefsDump refsDump, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = restoreRefsValidateBeforeCall(repository, refsDump, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIrestoreRefsRequest { + private final String repository; + private final RefsDump refsDump; + + private APIrestoreRefsRequest(String repository, RefsDump refsDump) { + this.repository = repository; + this.refsDump = refsDump; + } + + /** + * Build call for restoreRefs + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 refs successfully loaded -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return restoreRefsCall(repository, refsDump, _callback); + } + + /** + * Execute restoreRefs request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 refs successfully loaded -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + restoreRefsWithHttpInfo(repository, refsDump); + } + + /** + * Execute restoreRefs request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 refs successfully loaded -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return restoreRefsWithHttpInfo(repository, refsDump); + } + + /** + * Execute restoreRefs request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 refs successfully loaded -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return restoreRefsAsync(repository, refsDump, _callback); + } + } + + /** + * Restore repository refs (tags, commits, branches) from object store + * + * @param repository (required) + * @param refsDump (required) + * @return APIrestoreRefsRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 refs successfully loaded -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIrestoreRefsRequest restoreRefs(String repository, RefsDump refsDump) { + return new APIrestoreRefsRequest(repository, refsDump); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/RepositoriesApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/RepositoriesApi.java new file mode 100644 index 00000000000..37d95179ef8 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/RepositoriesApi.java @@ -0,0 +1,1473 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.BranchProtectionRule; +import io.lakefs.clients.sdk.model.DeleteBranchProtectionRuleRequest; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Repository; +import io.lakefs.clients.sdk.model.RepositoryCreation; +import io.lakefs.clients.sdk.model.RepositoryList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RepositoriesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RepositoriesApi() { + this(Configuration.getDefaultApiClient()); + } + + public RepositoriesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call createBranchProtectionRuleCall(String repository, BranchProtectionRule branchProtectionRule, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = branchProtectionRule; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branch_protection" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBranchProtectionRuleValidateBeforeCall(String repository, BranchProtectionRule branchProtectionRule, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling createBranchProtectionRule(Async)"); + } + + // verify the required parameter 'branchProtectionRule' is set + if (branchProtectionRule == null) { + throw new ApiException("Missing the required parameter 'branchProtectionRule' when calling createBranchProtectionRule(Async)"); + } + + return createBranchProtectionRuleCall(repository, branchProtectionRule, _callback); + + } + + + private ApiResponse createBranchProtectionRuleWithHttpInfo(String repository, BranchProtectionRule branchProtectionRule) throws ApiException { + okhttp3.Call localVarCall = createBranchProtectionRuleValidateBeforeCall(repository, branchProtectionRule, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call createBranchProtectionRuleAsync(String repository, BranchProtectionRule branchProtectionRule, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBranchProtectionRuleValidateBeforeCall(repository, branchProtectionRule, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIcreateBranchProtectionRuleRequest { + private final String repository; + private final BranchProtectionRule branchProtectionRule; + + private APIcreateBranchProtectionRuleRequest(String repository, BranchProtectionRule branchProtectionRule) { + this.repository = repository; + this.branchProtectionRule = branchProtectionRule; + } + + /** + * Build call for createBranchProtectionRule + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule created successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createBranchProtectionRuleCall(repository, branchProtectionRule, _callback); + } + + /** + * Execute createBranchProtectionRule request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule created successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + createBranchProtectionRuleWithHttpInfo(repository, branchProtectionRule); + } + + /** + * Execute createBranchProtectionRule request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule created successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createBranchProtectionRuleWithHttpInfo(repository, branchProtectionRule); + } + + /** + * Execute createBranchProtectionRule request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule created successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createBranchProtectionRuleAsync(repository, branchProtectionRule, _callback); + } + } + + /** + * + * + * @param repository (required) + * @param branchProtectionRule (required) + * @return APIcreateBranchProtectionRuleRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule created successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIcreateBranchProtectionRuleRequest createBranchProtectionRule(String repository, BranchProtectionRule branchProtectionRule) { + return new APIcreateBranchProtectionRuleRequest(repository, branchProtectionRule); + } + private okhttp3.Call createRepositoryCall(RepositoryCreation repositoryCreation, Boolean bare, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = repositoryCreation; + + // create path and map variables + String localVarPath = "/repositories"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (bare != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("bare", bare)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createRepositoryValidateBeforeCall(RepositoryCreation repositoryCreation, Boolean bare, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repositoryCreation' is set + if (repositoryCreation == null) { + throw new ApiException("Missing the required parameter 'repositoryCreation' when calling createRepository(Async)"); + } + + return createRepositoryCall(repositoryCreation, bare, _callback); + + } + + + private ApiResponse createRepositoryWithHttpInfo(RepositoryCreation repositoryCreation, Boolean bare) throws ApiException { + okhttp3.Call localVarCall = createRepositoryValidateBeforeCall(repositoryCreation, bare, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createRepositoryAsync(RepositoryCreation repositoryCreation, Boolean bare, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createRepositoryValidateBeforeCall(repositoryCreation, bare, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateRepositoryRequest { + private final RepositoryCreation repositoryCreation; + private Boolean bare; + + private APIcreateRepositoryRequest(RepositoryCreation repositoryCreation) { + this.repositoryCreation = repositoryCreation; + } + + /** + * Set bare + * @param bare If true, create a bare repository with no initial commit and branch (optional, default to false) + * @return APIcreateRepositoryRequest + */ + public APIcreateRepositoryRequest bare(Boolean bare) { + this.bare = bare; + return this; + } + + /** + * Build call for createRepository + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 repository -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createRepositoryCall(repositoryCreation, bare, _callback); + } + + /** + * Execute createRepository request + * @return Repository + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 repository -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public Repository execute() throws ApiException { + ApiResponse localVarResp = createRepositoryWithHttpInfo(repositoryCreation, bare); + return localVarResp.getData(); + } + + /** + * Execute createRepository request with HTTP info returned + * @return ApiResponse<Repository> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 repository -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createRepositoryWithHttpInfo(repositoryCreation, bare); + } + + /** + * Execute createRepository request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 repository -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createRepositoryAsync(repositoryCreation, bare, _callback); + } + } + + /** + * create repository + * + * @param repositoryCreation (required) + * @return APIcreateRepositoryRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 repository -
400 Validation Error -
401 Unauthorized -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreateRepositoryRequest createRepository(RepositoryCreation repositoryCreation) { + return new APIcreateRepositoryRequest(repositoryCreation); + } + private okhttp3.Call deleteBranchProtectionRuleCall(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteBranchProtectionRuleRequest; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branch_protection" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteBranchProtectionRuleValidateBeforeCall(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteBranchProtectionRule(Async)"); + } + + // verify the required parameter 'deleteBranchProtectionRuleRequest' is set + if (deleteBranchProtectionRuleRequest == null) { + throw new ApiException("Missing the required parameter 'deleteBranchProtectionRuleRequest' when calling deleteBranchProtectionRule(Async)"); + } + + return deleteBranchProtectionRuleCall(repository, deleteBranchProtectionRuleRequest, _callback); + + } + + + private ApiResponse deleteBranchProtectionRuleWithHttpInfo(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest) throws ApiException { + okhttp3.Call localVarCall = deleteBranchProtectionRuleValidateBeforeCall(repository, deleteBranchProtectionRuleRequest, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteBranchProtectionRuleAsync(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteBranchProtectionRuleValidateBeforeCall(repository, deleteBranchProtectionRuleRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteBranchProtectionRuleRequest { + private final String repository; + private final DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest; + + private APIdeleteBranchProtectionRuleRequest(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest) { + this.repository = repository; + this.deleteBranchProtectionRuleRequest = deleteBranchProtectionRuleRequest; + } + + /** + * Build call for deleteBranchProtectionRule + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteBranchProtectionRuleCall(repository, deleteBranchProtectionRuleRequest, _callback); + } + + /** + * Execute deleteBranchProtectionRule request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteBranchProtectionRuleWithHttpInfo(repository, deleteBranchProtectionRuleRequest); + } + + /** + * Execute deleteBranchProtectionRule request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteBranchProtectionRuleWithHttpInfo(repository, deleteBranchProtectionRuleRequest); + } + + /** + * Execute deleteBranchProtectionRule request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteBranchProtectionRuleAsync(repository, deleteBranchProtectionRuleRequest, _callback); + } + } + + /** + * + * + * @param repository (required) + * @param deleteBranchProtectionRuleRequest (required) + * @return APIdeleteBranchProtectionRuleRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 branch protection rule deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteBranchProtectionRuleRequest deleteBranchProtectionRule(String repository, DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest) { + return new APIdeleteBranchProtectionRuleRequest(repository, deleteBranchProtectionRuleRequest); + } + private okhttp3.Call deleteRepositoryCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteRepositoryValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteRepository(Async)"); + } + + return deleteRepositoryCall(repository, _callback); + + } + + + private ApiResponse deleteRepositoryWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = deleteRepositoryValidateBeforeCall(repository, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteRepositoryAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteRepositoryValidateBeforeCall(repository, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteRepositoryRequest { + private final String repository; + + private APIdeleteRepositoryRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for deleteRepository + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 repository deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteRepositoryCall(repository, _callback); + } + + /** + * Execute deleteRepository request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 repository deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteRepositoryWithHttpInfo(repository); + } + + /** + * Execute deleteRepository request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 repository deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteRepositoryWithHttpInfo(repository); + } + + /** + * Execute deleteRepository request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 repository deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteRepositoryAsync(repository, _callback); + } + } + + /** + * delete repository + * + * @param repository (required) + * @return APIdeleteRepositoryRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 repository deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteRepositoryRequest deleteRepository(String repository) { + return new APIdeleteRepositoryRequest(repository); + } + private okhttp3.Call getBranchProtectionRulesCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branch_protection" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBranchProtectionRulesValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getBranchProtectionRules(Async)"); + } + + return getBranchProtectionRulesCall(repository, _callback); + + } + + + private ApiResponse> getBranchProtectionRulesWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = getBranchProtectionRulesValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getBranchProtectionRulesAsync(String repository, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getBranchProtectionRulesValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetBranchProtectionRulesRequest { + private final String repository; + + private APIgetBranchProtectionRulesRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for getBranchProtectionRules + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch protection rules -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getBranchProtectionRulesCall(repository, _callback); + } + + /** + * Execute getBranchProtectionRules request + * @return List<BranchProtectionRule> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch protection rules -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getBranchProtectionRulesWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute getBranchProtectionRules request with HTTP info returned + * @return ApiResponse<List<BranchProtectionRule>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch protection rules -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getBranchProtectionRulesWithHttpInfo(repository); + } + + /** + * Execute getBranchProtectionRules request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch protection rules -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getBranchProtectionRulesAsync(repository, _callback); + } + } + + /** + * get branch protection rules + * + * @param repository (required) + * @return APIgetBranchProtectionRulesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 branch protection rules -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetBranchProtectionRulesRequest getBranchProtectionRules(String repository) { + return new APIgetBranchProtectionRulesRequest(repository); + } + private okhttp3.Call getRepositoryCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRepositoryValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getRepository(Async)"); + } + + return getRepositoryCall(repository, _callback); + + } + + + private ApiResponse getRepositoryWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = getRepositoryValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getRepositoryAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getRepositoryValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetRepositoryRequest { + private final String repository; + + private APIgetRepositoryRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for getRepository + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getRepositoryCall(repository, _callback); + } + + /** + * Execute getRepository request + * @return Repository + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Repository execute() throws ApiException { + ApiResponse localVarResp = getRepositoryWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute getRepository request with HTTP info returned + * @return ApiResponse<Repository> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getRepositoryWithHttpInfo(repository); + } + + /** + * Execute getRepository request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getRepositoryAsync(repository, _callback); + } + } + + /** + * get repository + * + * @param repository (required) + * @return APIgetRepositoryRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetRepositoryRequest getRepository(String repository) { + return new APIgetRepositoryRequest(repository); + } + private okhttp3.Call getRepositoryMetadataCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/metadata" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRepositoryMetadataValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getRepositoryMetadata(Async)"); + } + + return getRepositoryMetadataCall(repository, _callback); + + } + + + private ApiResponse> getRepositoryMetadataWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = getRepositoryMetadataValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getRepositoryMetadataAsync(String repository, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getRepositoryMetadataValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetRepositoryMetadataRequest { + private final String repository; + + private APIgetRepositoryMetadataRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for getRepositoryMetadata + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository metadata -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getRepositoryMetadataCall(repository, _callback); + } + + /** + * Execute getRepositoryMetadata request + * @return Map<String, String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository metadata -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Map execute() throws ApiException { + ApiResponse> localVarResp = getRepositoryMetadataWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute getRepositoryMetadata request with HTTP info returned + * @return ApiResponse<Map<String, String>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository metadata -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getRepositoryMetadataWithHttpInfo(repository); + } + + /** + * Execute getRepositoryMetadata request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository metadata -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getRepositoryMetadataAsync(repository, _callback); + } + } + + /** + * get repository metadata + * + * @param repository (required) + * @return APIgetRepositoryMetadataRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 repository metadata -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetRepositoryMetadataRequest getRepositoryMetadata(String repository) { + return new APIgetRepositoryMetadataRequest(repository); + } + private okhttp3.Call listRepositoriesCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listRepositoriesValidateBeforeCall(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + return listRepositoriesCall(prefix, after, amount, _callback); + + } + + + private ApiResponse listRepositoriesWithHttpInfo(String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listRepositoriesValidateBeforeCall(prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listRepositoriesAsync(String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listRepositoriesValidateBeforeCall(prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistRepositoriesRequest { + private String prefix; + private String after; + private Integer amount; + + private APIlistRepositoriesRequest() { + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistRepositoriesRequest + */ + public APIlistRepositoriesRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistRepositoriesRequest + */ + public APIlistRepositoriesRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistRepositoriesRequest + */ + public APIlistRepositoriesRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listRepositories + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 repository list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listRepositoriesCall(prefix, after, amount, _callback); + } + + /** + * Execute listRepositories request + * @return RepositoryList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 repository list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public RepositoryList execute() throws ApiException { + ApiResponse localVarResp = listRepositoriesWithHttpInfo(prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listRepositories request with HTTP info returned + * @return ApiResponse<RepositoryList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 repository list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listRepositoriesWithHttpInfo(prefix, after, amount); + } + + /** + * Execute listRepositories request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 repository list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listRepositoriesAsync(prefix, after, amount, _callback); + } + } + + /** + * list repositories + * + * @return APIlistRepositoriesRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 repository list -
401 Unauthorized -
0 Internal Server Error -
+ */ + public APIlistRepositoriesRequest listRepositories() { + return new APIlistRepositoriesRequest(); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/RetentionApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/RetentionApi.java new file mode 100644 index 00000000000..4317dd1f3d4 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/RetentionApi.java @@ -0,0 +1,932 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.GarbageCollectionPrepareResponse; +import io.lakefs.clients.sdk.model.GarbageCollectionRules; +import io.lakefs.clients.sdk.model.PrepareGCUncommittedRequest; +import io.lakefs.clients.sdk.model.PrepareGCUncommittedResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RetentionApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RetentionApi() { + this(Configuration.getDefaultApiClient()); + } + + public RetentionApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call deleteGarbageCollectionRulesCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/rules" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteGarbageCollectionRulesValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteGarbageCollectionRules(Async)"); + } + + return deleteGarbageCollectionRulesCall(repository, _callback); + + } + + + private ApiResponse deleteGarbageCollectionRulesWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = deleteGarbageCollectionRulesValidateBeforeCall(repository, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteGarbageCollectionRulesAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteGarbageCollectionRulesValidateBeforeCall(repository, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteGarbageCollectionRulesRequest { + private final String repository; + + private APIdeleteGarbageCollectionRulesRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for deleteGarbageCollectionRules + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 deleted garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteGarbageCollectionRulesCall(repository, _callback); + } + + /** + * Execute deleteGarbageCollectionRules request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 deleted garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteGarbageCollectionRulesWithHttpInfo(repository); + } + + /** + * Execute deleteGarbageCollectionRules request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 deleted garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteGarbageCollectionRulesWithHttpInfo(repository); + } + + /** + * Execute deleteGarbageCollectionRules request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 deleted garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteGarbageCollectionRulesAsync(repository, _callback); + } + } + + /** + * + * + * @param repository (required) + * @return APIdeleteGarbageCollectionRulesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 deleted garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteGarbageCollectionRulesRequest deleteGarbageCollectionRules(String repository) { + return new APIdeleteGarbageCollectionRulesRequest(repository); + } + private okhttp3.Call getGarbageCollectionRulesCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/rules" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGarbageCollectionRulesValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getGarbageCollectionRules(Async)"); + } + + return getGarbageCollectionRulesCall(repository, _callback); + + } + + + private ApiResponse getGarbageCollectionRulesWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = getGarbageCollectionRulesValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getGarbageCollectionRulesAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGarbageCollectionRulesValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetGarbageCollectionRulesRequest { + private final String repository; + + private APIgetGarbageCollectionRulesRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for getGarbageCollectionRules + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 gc rule list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getGarbageCollectionRulesCall(repository, _callback); + } + + /** + * Execute getGarbageCollectionRules request + * @return GarbageCollectionRules + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 gc rule list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public GarbageCollectionRules execute() throws ApiException { + ApiResponse localVarResp = getGarbageCollectionRulesWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute getGarbageCollectionRules request with HTTP info returned + * @return ApiResponse<GarbageCollectionRules> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 gc rule list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getGarbageCollectionRulesWithHttpInfo(repository); + } + + /** + * Execute getGarbageCollectionRules request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 gc rule list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getGarbageCollectionRulesAsync(repository, _callback); + } + } + + /** + * + * + * @param repository (required) + * @return APIgetGarbageCollectionRulesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 gc rule list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetGarbageCollectionRulesRequest getGarbageCollectionRules(String repository) { + return new APIgetGarbageCollectionRulesRequest(repository); + } + private okhttp3.Call prepareGarbageCollectionCommitsCall(String repository, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/prepare_commits" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call prepareGarbageCollectionCommitsValidateBeforeCall(String repository, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling prepareGarbageCollectionCommits(Async)"); + } + + return prepareGarbageCollectionCommitsCall(repository, _callback); + + } + + + private ApiResponse prepareGarbageCollectionCommitsWithHttpInfo(String repository) throws ApiException { + okhttp3.Call localVarCall = prepareGarbageCollectionCommitsValidateBeforeCall(repository, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call prepareGarbageCollectionCommitsAsync(String repository, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = prepareGarbageCollectionCommitsValidateBeforeCall(repository, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIprepareGarbageCollectionCommitsRequest { + private final String repository; + + private APIprepareGarbageCollectionCommitsRequest(String repository) { + this.repository = repository; + } + + /** + * Build call for prepareGarbageCollectionCommits + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return prepareGarbageCollectionCommitsCall(repository, _callback); + } + + /** + * Execute prepareGarbageCollectionCommits request + * @return GarbageCollectionPrepareResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public GarbageCollectionPrepareResponse execute() throws ApiException { + ApiResponse localVarResp = prepareGarbageCollectionCommitsWithHttpInfo(repository); + return localVarResp.getData(); + } + + /** + * Execute prepareGarbageCollectionCommits request with HTTP info returned + * @return ApiResponse<GarbageCollectionPrepareResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return prepareGarbageCollectionCommitsWithHttpInfo(repository); + } + + /** + * Execute prepareGarbageCollectionCommits request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return prepareGarbageCollectionCommitsAsync(repository, _callback); + } + } + + /** + * save lists of active commits for garbage collection + * + * @param repository (required) + * @return APIprepareGarbageCollectionCommitsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIprepareGarbageCollectionCommitsRequest prepareGarbageCollectionCommits(String repository) { + return new APIprepareGarbageCollectionCommitsRequest(repository); + } + private okhttp3.Call prepareGarbageCollectionUncommittedCall(String repository, PrepareGCUncommittedRequest prepareGCUncommittedRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = prepareGCUncommittedRequest; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/prepare_uncommited" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call prepareGarbageCollectionUncommittedValidateBeforeCall(String repository, PrepareGCUncommittedRequest prepareGCUncommittedRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling prepareGarbageCollectionUncommitted(Async)"); + } + + return prepareGarbageCollectionUncommittedCall(repository, prepareGCUncommittedRequest, _callback); + + } + + + private ApiResponse prepareGarbageCollectionUncommittedWithHttpInfo(String repository, PrepareGCUncommittedRequest prepareGCUncommittedRequest) throws ApiException { + okhttp3.Call localVarCall = prepareGarbageCollectionUncommittedValidateBeforeCall(repository, prepareGCUncommittedRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call prepareGarbageCollectionUncommittedAsync(String repository, PrepareGCUncommittedRequest prepareGCUncommittedRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = prepareGarbageCollectionUncommittedValidateBeforeCall(repository, prepareGCUncommittedRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIprepareGarbageCollectionUncommittedRequest { + private final String repository; + private PrepareGCUncommittedRequest prepareGCUncommittedRequest; + + private APIprepareGarbageCollectionUncommittedRequest(String repository) { + this.repository = repository; + } + + /** + * Set prepareGCUncommittedRequest + * @param prepareGCUncommittedRequest (optional) + * @return APIprepareGarbageCollectionUncommittedRequest + */ + public APIprepareGarbageCollectionUncommittedRequest prepareGCUncommittedRequest(PrepareGCUncommittedRequest prepareGCUncommittedRequest) { + this.prepareGCUncommittedRequest = prepareGCUncommittedRequest; + return this; + } + + /** + * Build call for prepareGarbageCollectionUncommitted + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return prepareGarbageCollectionUncommittedCall(repository, prepareGCUncommittedRequest, _callback); + } + + /** + * Execute prepareGarbageCollectionUncommitted request + * @return PrepareGCUncommittedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public PrepareGCUncommittedResponse execute() throws ApiException { + ApiResponse localVarResp = prepareGarbageCollectionUncommittedWithHttpInfo(repository, prepareGCUncommittedRequest); + return localVarResp.getData(); + } + + /** + * Execute prepareGarbageCollectionUncommitted request with HTTP info returned + * @return ApiResponse<PrepareGCUncommittedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return prepareGarbageCollectionUncommittedWithHttpInfo(repository, prepareGCUncommittedRequest); + } + + /** + * Execute prepareGarbageCollectionUncommitted request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return prepareGarbageCollectionUncommittedAsync(repository, prepareGCUncommittedRequest, _callback); + } + } + + /** + * save repository uncommitted metadata for garbage collection + * + * @param repository (required) + * @return APIprepareGarbageCollectionUncommittedRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 paths to commit dataset -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIprepareGarbageCollectionUncommittedRequest prepareGarbageCollectionUncommitted(String repository) { + return new APIprepareGarbageCollectionUncommittedRequest(repository); + } + private okhttp3.Call setGarbageCollectionRulesCall(String repository, GarbageCollectionRules garbageCollectionRules, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = garbageCollectionRules; + + // create path and map variables + String localVarPath = "/repositories/{repository}/gc/rules" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setGarbageCollectionRulesValidateBeforeCall(String repository, GarbageCollectionRules garbageCollectionRules, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling setGarbageCollectionRules(Async)"); + } + + // verify the required parameter 'garbageCollectionRules' is set + if (garbageCollectionRules == null) { + throw new ApiException("Missing the required parameter 'garbageCollectionRules' when calling setGarbageCollectionRules(Async)"); + } + + return setGarbageCollectionRulesCall(repository, garbageCollectionRules, _callback); + + } + + + private ApiResponse setGarbageCollectionRulesWithHttpInfo(String repository, GarbageCollectionRules garbageCollectionRules) throws ApiException { + okhttp3.Call localVarCall = setGarbageCollectionRulesValidateBeforeCall(repository, garbageCollectionRules, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call setGarbageCollectionRulesAsync(String repository, GarbageCollectionRules garbageCollectionRules, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setGarbageCollectionRulesValidateBeforeCall(repository, garbageCollectionRules, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIsetGarbageCollectionRulesRequest { + private final String repository; + private final GarbageCollectionRules garbageCollectionRules; + + private APIsetGarbageCollectionRulesRequest(String repository, GarbageCollectionRules garbageCollectionRules) { + this.repository = repository; + this.garbageCollectionRules = garbageCollectionRules; + } + + /** + * Build call for setGarbageCollectionRules + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 set garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return setGarbageCollectionRulesCall(repository, garbageCollectionRules, _callback); + } + + /** + * Execute setGarbageCollectionRules request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 set garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + setGarbageCollectionRulesWithHttpInfo(repository, garbageCollectionRules); + } + + /** + * Execute setGarbageCollectionRules request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 set garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return setGarbageCollectionRulesWithHttpInfo(repository, garbageCollectionRules); + } + + /** + * Execute setGarbageCollectionRules request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 set garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return setGarbageCollectionRulesAsync(repository, garbageCollectionRules, _callback); + } + } + + /** + * + * + * @param repository (required) + * @param garbageCollectionRules (required) + * @return APIsetGarbageCollectionRulesRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 set garbage collection rules successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIsetGarbageCollectionRulesRequest setGarbageCollectionRules(String repository, GarbageCollectionRules garbageCollectionRules) { + return new APIsetGarbageCollectionRulesRequest(repository, garbageCollectionRules); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java new file mode 100644 index 00000000000..946b24bf46d --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java @@ -0,0 +1,58 @@ +package io.lakefs.clients.sdk; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java new file mode 100644 index 00000000000..d873f9fdf87 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java @@ -0,0 +1,23 @@ +package io.lakefs.clients.sdk; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/StagingApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/StagingApi.java new file mode 100644 index 00000000000..3397dedfd9f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/StagingApi.java @@ -0,0 +1,488 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.StagingLocation; +import io.lakefs.clients.sdk.model.StagingMetadata; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StagingApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public StagingApi() { + this(Configuration.getDefaultApiClient()); + } + + public StagingApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call getPhysicalAddressCall(String repository, String branch, String path, Boolean presign, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/staging/backing" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (presign != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("presign", presign)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPhysicalAddressValidateBeforeCall(String repository, String branch, String path, Boolean presign, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getPhysicalAddress(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling getPhysicalAddress(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling getPhysicalAddress(Async)"); + } + + return getPhysicalAddressCall(repository, branch, path, presign, _callback); + + } + + + private ApiResponse getPhysicalAddressWithHttpInfo(String repository, String branch, String path, Boolean presign) throws ApiException { + okhttp3.Call localVarCall = getPhysicalAddressValidateBeforeCall(repository, branch, path, presign, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getPhysicalAddressAsync(String repository, String branch, String path, Boolean presign, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPhysicalAddressValidateBeforeCall(repository, branch, path, presign, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetPhysicalAddressRequest { + private final String repository; + private final String branch; + private final String path; + private Boolean presign; + + private APIgetPhysicalAddressRequest(String repository, String branch, String path) { + this.repository = repository; + this.branch = branch; + this.path = path; + } + + /** + * Set presign + * @param presign (optional) + * @return APIgetPhysicalAddressRequest + */ + public APIgetPhysicalAddressRequest presign(Boolean presign) { + this.presign = presign; + return this; + } + + /** + * Build call for getPhysicalAddress + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 physical address for staging area -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getPhysicalAddressCall(repository, branch, path, presign, _callback); + } + + /** + * Execute getPhysicalAddress request + * @return StagingLocation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 physical address for staging area -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public StagingLocation execute() throws ApiException { + ApiResponse localVarResp = getPhysicalAddressWithHttpInfo(repository, branch, path, presign); + return localVarResp.getData(); + } + + /** + * Execute getPhysicalAddress request with HTTP info returned + * @return ApiResponse<StagingLocation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 physical address for staging area -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPhysicalAddressWithHttpInfo(repository, branch, path, presign); + } + + /** + * Execute getPhysicalAddress request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 physical address for staging area -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPhysicalAddressAsync(repository, branch, path, presign, _callback); + } + } + + /** + * get a physical address and a return token to write object to underlying storage + * + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @return APIgetPhysicalAddressRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 physical address for staging area -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetPhysicalAddressRequest getPhysicalAddress(String repository, String branch, String path) { + return new APIgetPhysicalAddressRequest(repository, branch, path); + } + private okhttp3.Call linkPhysicalAddressCall(String repository, String branch, String path, StagingMetadata stagingMetadata, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = stagingMetadata; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/staging/backing" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call linkPhysicalAddressValidateBeforeCall(String repository, String branch, String path, StagingMetadata stagingMetadata, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling linkPhysicalAddress(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling linkPhysicalAddress(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling linkPhysicalAddress(Async)"); + } + + // verify the required parameter 'stagingMetadata' is set + if (stagingMetadata == null) { + throw new ApiException("Missing the required parameter 'stagingMetadata' when calling linkPhysicalAddress(Async)"); + } + + return linkPhysicalAddressCall(repository, branch, path, stagingMetadata, _callback); + + } + + + private ApiResponse linkPhysicalAddressWithHttpInfo(String repository, String branch, String path, StagingMetadata stagingMetadata) throws ApiException { + okhttp3.Call localVarCall = linkPhysicalAddressValidateBeforeCall(repository, branch, path, stagingMetadata, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call linkPhysicalAddressAsync(String repository, String branch, String path, StagingMetadata stagingMetadata, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = linkPhysicalAddressValidateBeforeCall(repository, branch, path, stagingMetadata, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlinkPhysicalAddressRequest { + private final String repository; + private final String branch; + private final String path; + private final StagingMetadata stagingMetadata; + + private APIlinkPhysicalAddressRequest(String repository, String branch, String path, StagingMetadata stagingMetadata) { + this.repository = repository; + this.branch = branch; + this.path = path; + this.stagingMetadata = stagingMetadata; + } + + /** + * Build call for linkPhysicalAddress + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
400 Validation Error -
401 Unauthorized -
404 Internal Server Error -
409 conflict with a commit, try here -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return linkPhysicalAddressCall(repository, branch, path, stagingMetadata, _callback); + } + + /** + * Execute linkPhysicalAddress request + * @return ObjectStats + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
400 Validation Error -
401 Unauthorized -
404 Internal Server Error -
409 conflict with a commit, try here -
0 Internal Server Error -
+ */ + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = linkPhysicalAddressWithHttpInfo(repository, branch, path, stagingMetadata); + return localVarResp.getData(); + } + + /** + * Execute linkPhysicalAddress request with HTTP info returned + * @return ApiResponse<ObjectStats> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
400 Validation Error -
401 Unauthorized -
404 Internal Server Error -
409 conflict with a commit, try here -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return linkPhysicalAddressWithHttpInfo(repository, branch, path, stagingMetadata); + } + + /** + * Execute linkPhysicalAddress request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
400 Validation Error -
401 Unauthorized -
404 Internal Server Error -
409 conflict with a commit, try here -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return linkPhysicalAddressAsync(repository, branch, path, stagingMetadata, _callback); + } + } + + /** + * associate staging on this physical address with a path + * If the supplied token matches the current staging token, associate the object as the physical address with the supplied path. Otherwise, if staging has been committed and the token has expired, return a conflict and hint where to place the object to try again. Caller should copy the object to the new physical address and PUT again with the new staging token. (No need to back off, this is due to losing the race against a concurrent commit operation.) + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @param stagingMetadata (required) + * @return APIlinkPhysicalAddressRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 object metadata -
400 Validation Error -
401 Unauthorized -
404 Internal Server Error -
409 conflict with a commit, try here -
0 Internal Server Error -
+ */ + public APIlinkPhysicalAddressRequest linkPhysicalAddress(String repository, String branch, String path, StagingMetadata stagingMetadata) { + return new APIlinkPhysicalAddressRequest(repository, branch, path, stagingMetadata); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java b/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java new file mode 100644 index 00000000000..a1b627f745f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java @@ -0,0 +1,83 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/TagsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/TagsApi.java new file mode 100644 index 00000000000..da274b2fb79 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/TagsApi.java @@ -0,0 +1,824 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiCallback; +import io.lakefs.clients.sdk.ApiClient; +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.ApiResponse; +import io.lakefs.clients.sdk.Configuration; +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ProgressRequestBody; +import io.lakefs.clients.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Ref; +import io.lakefs.clients.sdk.model.RefList; +import io.lakefs.clients.sdk.model.TagCreation; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TagsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TagsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TagsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + private okhttp3.Call createTagCall(String repository, TagCreation tagCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = tagCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/tags" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTagValidateBeforeCall(String repository, TagCreation tagCreation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling createTag(Async)"); + } + + // verify the required parameter 'tagCreation' is set + if (tagCreation == null) { + throw new ApiException("Missing the required parameter 'tagCreation' when calling createTag(Async)"); + } + + return createTagCall(repository, tagCreation, _callback); + + } + + + private ApiResponse createTagWithHttpInfo(String repository, TagCreation tagCreation) throws ApiException { + okhttp3.Call localVarCall = createTagValidateBeforeCall(repository, tagCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createTagAsync(String repository, TagCreation tagCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createTagValidateBeforeCall(repository, tagCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreateTagRequest { + private final String repository; + private final TagCreation tagCreation; + + private APIcreateTagRequest(String repository, TagCreation tagCreation) { + this.repository = repository; + this.tagCreation = tagCreation; + } + + /** + * Build call for createTag + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 tag -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createTagCall(repository, tagCreation, _callback); + } + + /** + * Execute createTag request + * @return Ref + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 tag -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public Ref execute() throws ApiException { + ApiResponse localVarResp = createTagWithHttpInfo(repository, tagCreation); + return localVarResp.getData(); + } + + /** + * Execute createTag request with HTTP info returned + * @return ApiResponse<Ref> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 tag -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createTagWithHttpInfo(repository, tagCreation); + } + + /** + * Execute createTag request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 tag -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createTagAsync(repository, tagCreation, _callback); + } + } + + /** + * create tag + * + * @param repository (required) + * @param tagCreation (required) + * @return APIcreateTagRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 tag -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -
+ */ + public APIcreateTagRequest createTag(String repository, TagCreation tagCreation) { + return new APIcreateTagRequest(repository, tagCreation); + } + private okhttp3.Call deleteTagCall(String repository, String tag, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/tags/{tag}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "tag" + "}", localVarApiClient.escapeString(tag.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTagValidateBeforeCall(String repository, String tag, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling deleteTag(Async)"); + } + + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException("Missing the required parameter 'tag' when calling deleteTag(Async)"); + } + + return deleteTagCall(repository, tag, _callback); + + } + + + private ApiResponse deleteTagWithHttpInfo(String repository, String tag) throws ApiException { + okhttp3.Call localVarCall = deleteTagValidateBeforeCall(repository, tag, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deleteTagAsync(String repository, String tag, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTagValidateBeforeCall(repository, tag, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteTagRequest { + private final String repository; + private final String tag; + + private APIdeleteTagRequest(String repository, String tag) { + this.repository = repository; + this.tag = tag; + } + + /** + * Build call for deleteTag + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 tag deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteTagCall(repository, tag, _callback); + } + + /** + * Execute deleteTag request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 tag deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteTagWithHttpInfo(repository, tag); + } + + /** + * Execute deleteTag request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 tag deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteTagWithHttpInfo(repository, tag); + } + + /** + * Execute deleteTag request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 tag deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteTagAsync(repository, tag, _callback); + } + } + + /** + * delete tag + * + * @param repository (required) + * @param tag (required) + * @return APIdeleteTagRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 tag deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIdeleteTagRequest deleteTag(String repository, String tag) { + return new APIdeleteTagRequest(repository, tag); + } + private okhttp3.Call getTagCall(String repository, String tag, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/tags/{tag}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "tag" + "}", localVarApiClient.escapeString(tag.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTagValidateBeforeCall(String repository, String tag, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling getTag(Async)"); + } + + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException("Missing the required parameter 'tag' when calling getTag(Async)"); + } + + return getTagCall(repository, tag, _callback); + + } + + + private ApiResponse getTagWithHttpInfo(String repository, String tag) throws ApiException { + okhttp3.Call localVarCall = getTagValidateBeforeCall(repository, tag, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getTagAsync(String repository, String tag, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTagValidateBeforeCall(repository, tag, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTagRequest { + private final String repository; + private final String tag; + + private APIgetTagRequest(String repository, String tag) { + this.repository = repository; + this.tag = tag; + } + + /** + * Build call for getTag + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTagCall(repository, tag, _callback); + } + + /** + * Execute getTag request + * @return Ref + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public Ref execute() throws ApiException { + ApiResponse localVarResp = getTagWithHttpInfo(repository, tag); + return localVarResp.getData(); + } + + /** + * Execute getTag request with HTTP info returned + * @return ApiResponse<Ref> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTagWithHttpInfo(repository, tag); + } + + /** + * Execute getTag request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTagAsync(repository, tag, _callback); + } + } + + /** + * get tag + * + * @param repository (required) + * @param tag (required) + * @return APIgetTagRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIgetTagRequest getTag(String repository, String tag) { + return new APIgetTagRequest(repository, tag); + } + private okhttp3.Call listTagsCall(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/tags" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTagsValidateBeforeCall(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling listTags(Async)"); + } + + return listTagsCall(repository, prefix, after, amount, _callback); + + } + + + private ApiResponse listTagsWithHttpInfo(String repository, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listTagsValidateBeforeCall(repository, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listTagsAsync(String repository, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTagsValidateBeforeCall(repository, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistTagsRequest { + private final String repository; + private String prefix; + private String after; + private Integer amount; + + private APIlistTagsRequest(String repository) { + this.repository = repository; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistTagsRequest + */ + public APIlistTagsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistTagsRequest + */ + public APIlistTagsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistTagsRequest + */ + public APIlistTagsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listTags + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listTagsCall(repository, prefix, after, amount, _callback); + } + + /** + * Execute listTags request + * @return RefList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public RefList execute() throws ApiException { + ApiResponse localVarResp = listTagsWithHttpInfo(repository, prefix, after, amount); + return localVarResp.getData(); + } + + /** + * Execute listTags request with HTTP info returned + * @return ApiResponse<RefList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listTagsWithHttpInfo(repository, prefix, after, amount); + } + + /** + * Execute listTags request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listTagsAsync(repository, prefix, after, amount, _callback); + } + } + + /** + * list tags + * + * @param repository (required) + * @return APIlistTagsRequest + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 tag list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public APIlistTagsRequest listTags(String repository) { + return new APIlistTagsRequest(repository); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..a635443b1b6 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.auth; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/Authentication.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/Authentication.java new file mode 100644 index 00000000000..b01405224b3 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.auth; + +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..e8de95fa5f3 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.auth; + +import io.lakefs.clients.sdk.Pair; +import io.lakefs.clients.sdk.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..b2b366ecc0e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.auth; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java new file mode 100644 index 00000000000..ff27dc88e1c --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ACL + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ACL { + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + private String permission; + + public ACL() { + } + + public ACL permission(String permission) { + + this.permission = permission; + return this; + } + + /** + * Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. + * @return permission + **/ + @javax.annotation.Nonnull + public String getPermission() { + return permission; + } + + + public void setPermission(String permission) { + this.permission = permission; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ACL instance itself + */ + public ACL putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ACL ACL = (ACL) o; + return Objects.equals(this.permission, ACL.permission)&& + Objects.equals(this.additionalProperties, ACL.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(permission, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ACL {\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permission"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permission"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ACL + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ACL.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ACL is not found in the empty JSON string", ACL.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ACL.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permission").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ACL.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ACL' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ACL.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ACL value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ACL read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ACL instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ACL given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACL + * @throws IOException if the JSON string is invalid with respect to ACL + */ + public static ACL fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ACL.class); + } + + /** + * Convert an instance of ACL to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..dd0ecd310e1 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import io.lakefs.clients.sdk.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java new file mode 100644 index 00000000000..19b7c7c66bc --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java @@ -0,0 +1,325 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * AccessKeyCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AccessKeyCredentials { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + private String secretAccessKey; + + public AccessKeyCredentials() { + } + + public AccessKeyCredentials accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * access key ID to set for user for use in integration testing. + * @return accessKeyId + **/ + @javax.annotation.Nonnull + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public AccessKeyCredentials secretAccessKey(String secretAccessKey) { + + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * secret access key to set for user for use in integration testing. + * @return secretAccessKey + **/ + @javax.annotation.Nonnull + public String getSecretAccessKey() { + return secretAccessKey; + } + + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessKeyCredentials instance itself + */ + public AccessKeyCredentials putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessKeyCredentials accessKeyCredentials = (AccessKeyCredentials) o; + return Objects.equals(this.accessKeyId, accessKeyCredentials.accessKeyId) && + Objects.equals(this.secretAccessKey, accessKeyCredentials.secretAccessKey)&& + Objects.equals(this.additionalProperties, accessKeyCredentials.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessKeyCredentials {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("secret_access_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("access_key_id"); + openapiRequiredFields.add("secret_access_key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccessKeyCredentials + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessKeyCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessKeyCredentials is not found in the empty JSON string", AccessKeyCredentials.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccessKeyCredentials.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + if (!jsonObj.get("secret_access_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret_access_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_access_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessKeyCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessKeyCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessKeyCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessKeyCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessKeyCredentials read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessKeyCredentials instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessKeyCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessKeyCredentials + * @throws IOException if the JSON string is invalid with respect to AccessKeyCredentials + */ + public static AccessKeyCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessKeyCredentials.class); + } + + /** + * Convert an instance of AccessKeyCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java new file mode 100644 index 00000000000..b6f249c0dcd --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java @@ -0,0 +1,526 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ActionRun + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ActionRun { + public static final String SERIALIZED_NAME_RUN_ID = "run_id"; + @SerializedName(SERIALIZED_NAME_RUN_ID) + private String runId; + + public static final String SERIALIZED_NAME_BRANCH = "branch"; + @SerializedName(SERIALIZED_NAME_BRANCH) + private String branch; + + public static final String SERIALIZED_NAME_START_TIME = "start_time"; + @SerializedName(SERIALIZED_NAME_START_TIME) + private OffsetDateTime startTime; + + public static final String SERIALIZED_NAME_END_TIME = "end_time"; + @SerializedName(SERIALIZED_NAME_END_TIME) + private OffsetDateTime endTime; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "event_type"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private String eventType; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + FAILED("failed"), + + COMPLETED("completed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.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 StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_COMMIT_ID = "commit_id"; + @SerializedName(SERIALIZED_NAME_COMMIT_ID) + private String commitId; + + public ActionRun() { + } + + public ActionRun runId(String runId) { + + this.runId = runId; + return this; + } + + /** + * Get runId + * @return runId + **/ + @javax.annotation.Nonnull + public String getRunId() { + return runId; + } + + + public void setRunId(String runId) { + this.runId = runId; + } + + + public ActionRun branch(String branch) { + + this.branch = branch; + return this; + } + + /** + * Get branch + * @return branch + **/ + @javax.annotation.Nonnull + public String getBranch() { + return branch; + } + + + public void setBranch(String branch) { + this.branch = branch; + } + + + public ActionRun startTime(OffsetDateTime startTime) { + + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getStartTime() { + return startTime; + } + + + public void setStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + } + + + public ActionRun endTime(OffsetDateTime endTime) { + + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + **/ + @javax.annotation.Nullable + public OffsetDateTime getEndTime() { + return endTime; + } + + + public void setEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + } + + + public ActionRun eventType(String eventType) { + + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + **/ + @javax.annotation.Nonnull + public String getEventType() { + return eventType; + } + + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + + public ActionRun status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public ActionRun commitId(String commitId) { + + this.commitId = commitId; + return this; + } + + /** + * Get commitId + * @return commitId + **/ + @javax.annotation.Nonnull + public String getCommitId() { + return commitId; + } + + + public void setCommitId(String commitId) { + this.commitId = commitId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ActionRun instance itself + */ + public ActionRun putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionRun actionRun = (ActionRun) o; + return Objects.equals(this.runId, actionRun.runId) && + Objects.equals(this.branch, actionRun.branch) && + Objects.equals(this.startTime, actionRun.startTime) && + Objects.equals(this.endTime, actionRun.endTime) && + Objects.equals(this.eventType, actionRun.eventType) && + Objects.equals(this.status, actionRun.status) && + Objects.equals(this.commitId, actionRun.commitId)&& + Objects.equals(this.additionalProperties, actionRun.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(runId, branch, startTime, endTime, eventType, status, commitId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionRun {\n"); + sb.append(" runId: ").append(toIndentedString(runId)).append("\n"); + sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" commitId: ").append(toIndentedString(commitId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("run_id"); + openapiFields.add("branch"); + openapiFields.add("start_time"); + openapiFields.add("end_time"); + openapiFields.add("event_type"); + openapiFields.add("status"); + openapiFields.add("commit_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("run_id"); + openapiRequiredFields.add("branch"); + openapiRequiredFields.add("start_time"); + openapiRequiredFields.add("event_type"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("commit_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActionRun + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActionRun.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ActionRun is not found in the empty JSON string", ActionRun.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ActionRun.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("run_id").toString())); + } + if (!jsonObj.get("branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); + } + if (!jsonObj.get("event_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `event_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event_type").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (!jsonObj.get("commit_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commit_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ActionRun.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActionRun' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ActionRun.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ActionRun value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ActionRun read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ActionRun instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ActionRun given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActionRun + * @throws IOException if the JSON string is invalid with respect to ActionRun + */ + public static ActionRun fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActionRun.class); + } + + /** + * Convert an instance of ActionRun to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java new file mode 100644 index 00000000000..3348304b62f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.ActionRun; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ActionRunList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ActionRunList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public ActionRunList() { + } + + public ActionRunList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public ActionRunList results(List results) { + + this.results = results; + return this; + } + + public ActionRunList addResultsItem(ActionRun resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ActionRunList instance itself + */ + public ActionRunList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionRunList actionRunList = (ActionRunList) o; + return Objects.equals(this.pagination, actionRunList.pagination) && + Objects.equals(this.results, actionRunList.results)&& + Objects.equals(this.additionalProperties, actionRunList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionRunList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActionRunList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActionRunList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ActionRunList is not found in the empty JSON string", ActionRunList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ActionRunList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + ActionRun.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ActionRunList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActionRunList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ActionRunList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ActionRunList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ActionRunList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ActionRunList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ActionRunList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActionRunList + * @throws IOException if the JSON string is invalid with respect to ActionRunList + */ + public static ActionRunList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActionRunList.class); + } + + /** + * Convert an instance of ActionRunList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java new file mode 100644 index 00000000000..bf71f67c7b0 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java @@ -0,0 +1,310 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * AuthCapabilities + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuthCapabilities { + public static final String SERIALIZED_NAME_INVITE_USER = "invite_user"; + @SerializedName(SERIALIZED_NAME_INVITE_USER) + private Boolean inviteUser; + + public static final String SERIALIZED_NAME_FORGOT_PASSWORD = "forgot_password"; + @SerializedName(SERIALIZED_NAME_FORGOT_PASSWORD) + private Boolean forgotPassword; + + public AuthCapabilities() { + } + + public AuthCapabilities inviteUser(Boolean inviteUser) { + + this.inviteUser = inviteUser; + return this; + } + + /** + * Get inviteUser + * @return inviteUser + **/ + @javax.annotation.Nullable + public Boolean getInviteUser() { + return inviteUser; + } + + + public void setInviteUser(Boolean inviteUser) { + this.inviteUser = inviteUser; + } + + + public AuthCapabilities forgotPassword(Boolean forgotPassword) { + + this.forgotPassword = forgotPassword; + return this; + } + + /** + * Get forgotPassword + * @return forgotPassword + **/ + @javax.annotation.Nullable + public Boolean getForgotPassword() { + return forgotPassword; + } + + + public void setForgotPassword(Boolean forgotPassword) { + this.forgotPassword = forgotPassword; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthCapabilities instance itself + */ + public AuthCapabilities putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthCapabilities authCapabilities = (AuthCapabilities) o; + return Objects.equals(this.inviteUser, authCapabilities.inviteUser) && + Objects.equals(this.forgotPassword, authCapabilities.forgotPassword)&& + Objects.equals(this.additionalProperties, authCapabilities.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(inviteUser, forgotPassword, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthCapabilities {\n"); + sb.append(" inviteUser: ").append(toIndentedString(inviteUser)).append("\n"); + sb.append(" forgotPassword: ").append(toIndentedString(forgotPassword)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invite_user"); + openapiFields.add("forgot_password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthCapabilities + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthCapabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthCapabilities is not found in the empty JSON string", AuthCapabilities.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthCapabilities.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthCapabilities' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthCapabilities.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthCapabilities value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthCapabilities read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthCapabilities instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthCapabilities given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthCapabilities + * @throws IOException if the JSON string is invalid with respect to AuthCapabilities + */ + public static AuthCapabilities fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthCapabilities.class); + } + + /** + * Convert an instance of AuthCapabilities to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java new file mode 100644 index 00000000000..0a1697c68a0 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java @@ -0,0 +1,321 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * AuthenticationToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuthenticationToken { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_TOKEN_EXPIRATION = "token_expiration"; + @SerializedName(SERIALIZED_NAME_TOKEN_EXPIRATION) + private Long tokenExpiration; + + public AuthenticationToken() { + } + + public AuthenticationToken token(String token) { + + this.token = token; + return this; + } + + /** + * a JWT token that could be used to authenticate requests + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + + public void setToken(String token) { + this.token = token; + } + + + public AuthenticationToken tokenExpiration(Long tokenExpiration) { + + this.tokenExpiration = tokenExpiration; + return this; + } + + /** + * Unix Epoch in seconds + * @return tokenExpiration + **/ + @javax.annotation.Nullable + public Long getTokenExpiration() { + return tokenExpiration; + } + + + public void setTokenExpiration(Long tokenExpiration) { + this.tokenExpiration = tokenExpiration; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthenticationToken instance itself + */ + public AuthenticationToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationToken authenticationToken = (AuthenticationToken) o; + return Objects.equals(this.token, authenticationToken.token) && + Objects.equals(this.tokenExpiration, authenticationToken.tokenExpiration)&& + Objects.equals(this.additionalProperties, authenticationToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(token, tokenExpiration, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationToken {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" tokenExpiration: ").append(toIndentedString(tokenExpiration)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + openapiFields.add("token_expiration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthenticationToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthenticationToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthenticationToken is not found in the empty JSON string", AuthenticationToken.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthenticationToken.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthenticationToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthenticationToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthenticationToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthenticationToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthenticationToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthenticationToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthenticationToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthenticationToken + * @throws IOException if the JSON string is invalid with respect to AuthenticationToken + */ + public static AuthenticationToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthenticationToken.class); + } + + /** + * Convert an instance of AuthenticationToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java new file mode 100644 index 00000000000..b7ba263dcf7 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java @@ -0,0 +1,325 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * BranchCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BranchCreation { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public BranchCreation() { + } + + public BranchCreation name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public BranchCreation source(String source) { + + this.source = source; + return this; + } + + /** + * Get source + * @return source + **/ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BranchCreation instance itself + */ + public BranchCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BranchCreation branchCreation = (BranchCreation) o; + return Objects.equals(this.name, branchCreation.name) && + Objects.equals(this.source, branchCreation.source)&& + Objects.equals(this.additionalProperties, branchCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BranchCreation {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("source"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("source"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BranchCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BranchCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BranchCreation is not found in the empty JSON string", BranchCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BranchCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BranchCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BranchCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BranchCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BranchCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BranchCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BranchCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BranchCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of BranchCreation + * @throws IOException if the JSON string is invalid with respect to BranchCreation + */ + public static BranchCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BranchCreation.class); + } + + /** + * Convert an instance of BranchCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java new file mode 100644 index 00000000000..2b8e7d56b6e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * BranchProtectionRule + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BranchProtectionRule { + public static final String SERIALIZED_NAME_PATTERN = "pattern"; + @SerializedName(SERIALIZED_NAME_PATTERN) + private String pattern; + + public BranchProtectionRule() { + } + + public BranchProtectionRule pattern(String pattern) { + + this.pattern = pattern; + return this; + } + + /** + * fnmatch pattern for the branch name, supporting * and ? wildcards + * @return pattern + **/ + @javax.annotation.Nonnull + public String getPattern() { + return pattern; + } + + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BranchProtectionRule instance itself + */ + public BranchProtectionRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BranchProtectionRule branchProtectionRule = (BranchProtectionRule) o; + return Objects.equals(this.pattern, branchProtectionRule.pattern)&& + Objects.equals(this.additionalProperties, branchProtectionRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pattern, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BranchProtectionRule {\n"); + sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pattern"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pattern"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BranchProtectionRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BranchProtectionRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BranchProtectionRule is not found in the empty JSON string", BranchProtectionRule.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BranchProtectionRule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pattern").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pattern` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BranchProtectionRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BranchProtectionRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BranchProtectionRule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BranchProtectionRule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BranchProtectionRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BranchProtectionRule instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BranchProtectionRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of BranchProtectionRule + * @throws IOException if the JSON string is invalid with respect to BranchProtectionRule + */ + public static BranchProtectionRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BranchProtectionRule.class); + } + + /** + * Convert an instance of BranchProtectionRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java new file mode 100644 index 00000000000..429c30f4dbc --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java @@ -0,0 +1,321 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CherryPickCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CherryPickCreation { + public static final String SERIALIZED_NAME_REF = "ref"; + @SerializedName(SERIALIZED_NAME_REF) + private String ref; + + public static final String SERIALIZED_NAME_PARENT_NUMBER = "parent_number"; + @SerializedName(SERIALIZED_NAME_PARENT_NUMBER) + private Integer parentNumber; + + public CherryPickCreation() { + } + + public CherryPickCreation ref(String ref) { + + this.ref = ref; + return this; + } + + /** + * the commit to cherry-pick, given by a ref + * @return ref + **/ + @javax.annotation.Nonnull + public String getRef() { + return ref; + } + + + public void setRef(String ref) { + this.ref = ref; + } + + + public CherryPickCreation parentNumber(Integer parentNumber) { + + this.parentNumber = parentNumber; + return this; + } + + /** + * when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. The destination branch is parent 1, which is the default behaviour. + * @return parentNumber + **/ + @javax.annotation.Nullable + public Integer getParentNumber() { + return parentNumber; + } + + + public void setParentNumber(Integer parentNumber) { + this.parentNumber = parentNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CherryPickCreation instance itself + */ + public CherryPickCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CherryPickCreation cherryPickCreation = (CherryPickCreation) o; + return Objects.equals(this.ref, cherryPickCreation.ref) && + Objects.equals(this.parentNumber, cherryPickCreation.parentNumber)&& + Objects.equals(this.additionalProperties, cherryPickCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ref, parentNumber, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CherryPickCreation {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" parentNumber: ").append(toIndentedString(parentNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ref"); + openapiFields.add("parent_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ref"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CherryPickCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CherryPickCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CherryPickCreation is not found in the empty JSON string", CherryPickCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CherryPickCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ref").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CherryPickCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CherryPickCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CherryPickCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CherryPickCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CherryPickCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CherryPickCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CherryPickCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CherryPickCreation + * @throws IOException if the JSON string is invalid with respect to CherryPickCreation + */ + public static CherryPickCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CherryPickCreation.class); + } + + /** + * Convert an instance of CherryPickCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java new file mode 100644 index 00000000000..1f099f55388 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java @@ -0,0 +1,350 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CommPrefsInput + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommPrefsInput { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_FEATURE_UPDATES = "featureUpdates"; + @SerializedName(SERIALIZED_NAME_FEATURE_UPDATES) + private Boolean featureUpdates; + + public static final String SERIALIZED_NAME_SECURITY_UPDATES = "securityUpdates"; + @SerializedName(SERIALIZED_NAME_SECURITY_UPDATES) + private Boolean securityUpdates; + + public CommPrefsInput() { + } + + public CommPrefsInput email(String email) { + + this.email = email; + return this; + } + + /** + * the provided email + * @return email + **/ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public CommPrefsInput featureUpdates(Boolean featureUpdates) { + + this.featureUpdates = featureUpdates; + return this; + } + + /** + * was \"feature updates\" checked + * @return featureUpdates + **/ + @javax.annotation.Nonnull + public Boolean getFeatureUpdates() { + return featureUpdates; + } + + + public void setFeatureUpdates(Boolean featureUpdates) { + this.featureUpdates = featureUpdates; + } + + + public CommPrefsInput securityUpdates(Boolean securityUpdates) { + + this.securityUpdates = securityUpdates; + return this; + } + + /** + * was \"security updates\" checked + * @return securityUpdates + **/ + @javax.annotation.Nonnull + public Boolean getSecurityUpdates() { + return securityUpdates; + } + + + public void setSecurityUpdates(Boolean securityUpdates) { + this.securityUpdates = securityUpdates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CommPrefsInput instance itself + */ + public CommPrefsInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommPrefsInput commPrefsInput = (CommPrefsInput) o; + return Objects.equals(this.email, commPrefsInput.email) && + Objects.equals(this.featureUpdates, commPrefsInput.featureUpdates) && + Objects.equals(this.securityUpdates, commPrefsInput.securityUpdates)&& + Objects.equals(this.additionalProperties, commPrefsInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, featureUpdates, securityUpdates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommPrefsInput {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" featureUpdates: ").append(toIndentedString(featureUpdates)).append("\n"); + sb.append(" securityUpdates: ").append(toIndentedString(securityUpdates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("featureUpdates"); + openapiFields.add("securityUpdates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("featureUpdates"); + openapiRequiredFields.add("securityUpdates"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommPrefsInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommPrefsInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommPrefsInput is not found in the empty JSON string", CommPrefsInput.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommPrefsInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommPrefsInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommPrefsInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommPrefsInput.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommPrefsInput value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CommPrefsInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CommPrefsInput instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommPrefsInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommPrefsInput + * @throws IOException if the JSON string is invalid with respect to CommPrefsInput + */ + public static CommPrefsInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommPrefsInput.class); + } + + /** + * Convert an instance of CommPrefsInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java new file mode 100644 index 00000000000..19eb3b4af8c --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java @@ -0,0 +1,501 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Commit + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Commit { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PARENTS = "parents"; + @SerializedName(SERIALIZED_NAME_PARENTS) + private List parents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COMMITTER = "committer"; + @SerializedName(SERIALIZED_NAME_COMMITTER) + private String committer; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public static final String SERIALIZED_NAME_META_RANGE_ID = "meta_range_id"; + @SerializedName(SERIALIZED_NAME_META_RANGE_ID) + private String metaRangeId; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = new HashMap<>(); + + public Commit() { + } + + public Commit id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Commit parents(List parents) { + + this.parents = parents; + return this; + } + + public Commit addParentsItem(String parentsItem) { + if (this.parents == null) { + this.parents = new ArrayList<>(); + } + this.parents.add(parentsItem); + return this; + } + + /** + * Get parents + * @return parents + **/ + @javax.annotation.Nonnull + public List getParents() { + return parents; + } + + + public void setParents(List parents) { + this.parents = parents; + } + + + public Commit committer(String committer) { + + this.committer = committer; + return this; + } + + /** + * Get committer + * @return committer + **/ + @javax.annotation.Nonnull + public String getCommitter() { + return committer; + } + + + public void setCommitter(String committer) { + this.committer = committer; + } + + + public Commit message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public Commit creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public Commit metaRangeId(String metaRangeId) { + + this.metaRangeId = metaRangeId; + return this; + } + + /** + * Get metaRangeId + * @return metaRangeId + **/ + @javax.annotation.Nonnull + public String getMetaRangeId() { + return metaRangeId; + } + + + public void setMetaRangeId(String metaRangeId) { + this.metaRangeId = metaRangeId; + } + + + public Commit metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public Commit putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Commit instance itself + */ + public Commit putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Commit commit = (Commit) o; + return Objects.equals(this.id, commit.id) && + Objects.equals(this.parents, commit.parents) && + Objects.equals(this.committer, commit.committer) && + Objects.equals(this.message, commit.message) && + Objects.equals(this.creationDate, commit.creationDate) && + Objects.equals(this.metaRangeId, commit.metaRangeId) && + Objects.equals(this.metadata, commit.metadata)&& + Objects.equals(this.additionalProperties, commit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, parents, committer, message, creationDate, metaRangeId, metadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Commit {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" parents: ").append(toIndentedString(parents)).append("\n"); + sb.append(" committer: ").append(toIndentedString(committer)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" metaRangeId: ").append(toIndentedString(metaRangeId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("parents"); + openapiFields.add("committer"); + openapiFields.add("message"); + openapiFields.add("creation_date"); + openapiFields.add("meta_range_id"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("parents"); + openapiRequiredFields.add("committer"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("creation_date"); + openapiRequiredFields.add("meta_range_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Commit + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Commit.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Commit is not found in the empty JSON string", Commit.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Commit.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("parents") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("parents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `parents` to be an array in the JSON string but got `%s`", jsonObj.get("parents").toString())); + } + if (!jsonObj.get("committer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `committer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("committer").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("meta_range_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `meta_range_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("meta_range_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Commit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Commit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Commit.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Commit value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Commit read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Commit instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Commit given an JSON string + * + * @param jsonString JSON string + * @return An instance of Commit + * @throws IOException if the JSON string is invalid with respect to Commit + */ + public static Commit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Commit.class); + } + + /** + * Convert an instance of Commit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java new file mode 100644 index 00000000000..4266c9908c5 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java @@ -0,0 +1,359 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CommitCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitCreation { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_DATE = "date"; + @SerializedName(SERIALIZED_NAME_DATE) + private Long date; + + public CommitCreation() { + } + + public CommitCreation message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public CommitCreation metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public CommitCreation putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public CommitCreation date(Long date) { + + this.date = date; + return this; + } + + /** + * set date to override creation date in the commit (Unix Epoch in seconds) + * @return date + **/ + @javax.annotation.Nullable + public Long getDate() { + return date; + } + + + public void setDate(Long date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CommitCreation instance itself + */ + public CommitCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitCreation commitCreation = (CommitCreation) o; + return Objects.equals(this.message, commitCreation.message) && + Objects.equals(this.metadata, commitCreation.metadata) && + Objects.equals(this.date, commitCreation.date)&& + Objects.equals(this.additionalProperties, commitCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, metadata, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitCreation {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("metadata"); + openapiFields.add("date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommitCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitCreation is not found in the empty JSON string", CommitCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CommitCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CommitCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitCreation + * @throws IOException if the JSON string is invalid with respect to CommitCreation + */ + public static CommitCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitCreation.class); + } + + /** + * Convert an instance of CommitCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java new file mode 100644 index 00000000000..bc543eaad9c --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CommitList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public CommitList() { + } + + public CommitList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public CommitList results(List results) { + + this.results = results; + return this; + } + + public CommitList addResultsItem(Commit resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CommitList instance itself + */ + public CommitList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitList commitList = (CommitList) o; + return Objects.equals(this.pagination, commitList.pagination) && + Objects.equals(this.results, commitList.results)&& + Objects.equals(this.additionalProperties, commitList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommitList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitList is not found in the empty JSON string", CommitList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Commit.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CommitList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CommitList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitList + * @throws IOException if the JSON string is invalid with respect to CommitList + */ + public static CommitList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitList.class); + } + + /** + * Convert an instance of CommitList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java new file mode 100644 index 00000000000..f2fcfd9a53b --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java @@ -0,0 +1,322 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Credentials { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public Credentials() { + } + + public Credentials accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get accessKeyId + * @return accessKeyId + **/ + @javax.annotation.Nonnull + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public Credentials creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Credentials instance itself + */ + public Credentials putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Credentials credentials = (Credentials) o; + return Objects.equals(this.accessKeyId, credentials.accessKeyId) && + Objects.equals(this.creationDate, credentials.creationDate)&& + Objects.equals(this.additionalProperties, credentials.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, creationDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Credentials {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("creation_date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("access_key_id"); + openapiRequiredFields.add("creation_date"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Credentials + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Credentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Credentials is not found in the empty JSON string", Credentials.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Credentials.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Credentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Credentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Credentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Credentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Credentials read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Credentials instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Credentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of Credentials + * @throws IOException if the JSON string is invalid with respect to Credentials + */ + public static Credentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Credentials.class); + } + + /** + * Convert an instance of Credentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java new file mode 100644 index 00000000000..f66b5e36562 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Credentials; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CredentialsList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CredentialsList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public CredentialsList() { + } + + public CredentialsList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public CredentialsList results(List results) { + + this.results = results; + return this; + } + + public CredentialsList addResultsItem(Credentials resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CredentialsList instance itself + */ + public CredentialsList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialsList credentialsList = (CredentialsList) o; + return Objects.equals(this.pagination, credentialsList.pagination) && + Objects.equals(this.results, credentialsList.results)&& + Objects.equals(this.additionalProperties, credentialsList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialsList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialsList is not found in the empty JSON string", CredentialsList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialsList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Credentials.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialsList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialsList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialsList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialsList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CredentialsList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CredentialsList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsList + * @throws IOException if the JSON string is invalid with respect to CredentialsList + */ + public static CredentialsList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialsList.class); + } + + /** + * Convert an instance of CredentialsList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java new file mode 100644 index 00000000000..22ded9a6683 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java @@ -0,0 +1,354 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CredentialsWithSecret + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CredentialsWithSecret { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + private String secretAccessKey; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public CredentialsWithSecret() { + } + + public CredentialsWithSecret accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get accessKeyId + * @return accessKeyId + **/ + @javax.annotation.Nonnull + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public CredentialsWithSecret secretAccessKey(String secretAccessKey) { + + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * Get secretAccessKey + * @return secretAccessKey + **/ + @javax.annotation.Nonnull + public String getSecretAccessKey() { + return secretAccessKey; + } + + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + + public CredentialsWithSecret creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CredentialsWithSecret instance itself + */ + public CredentialsWithSecret putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialsWithSecret credentialsWithSecret = (CredentialsWithSecret) o; + return Objects.equals(this.accessKeyId, credentialsWithSecret.accessKeyId) && + Objects.equals(this.secretAccessKey, credentialsWithSecret.secretAccessKey) && + Objects.equals(this.creationDate, credentialsWithSecret.creationDate)&& + Objects.equals(this.additionalProperties, credentialsWithSecret.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, creationDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialsWithSecret {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("secret_access_key"); + openapiFields.add("creation_date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("access_key_id"); + openapiRequiredFields.add("secret_access_key"); + openapiRequiredFields.add("creation_date"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsWithSecret + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialsWithSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialsWithSecret is not found in the empty JSON string", CredentialsWithSecret.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialsWithSecret.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + if (!jsonObj.get("secret_access_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret_access_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_access_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialsWithSecret.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialsWithSecret' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialsWithSecret.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialsWithSecret value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CredentialsWithSecret read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CredentialsWithSecret instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialsWithSecret given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsWithSecret + * @throws IOException if the JSON string is invalid with respect to CredentialsWithSecret + */ + public static CredentialsWithSecret fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialsWithSecret.class); + } + + /** + * Convert an instance of CredentialsWithSecret to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java new file mode 100644 index 00000000000..419c54a9892 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.User; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CurrentUser + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CurrentUser { + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private User user; + + public CurrentUser() { + } + + public CurrentUser user(User user) { + + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + public User getUser() { + return user; + } + + + public void setUser(User user) { + this.user = user; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CurrentUser instance itself + */ + public CurrentUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurrentUser currentUser = (CurrentUser) o; + return Objects.equals(this.user, currentUser.user)&& + Objects.equals(this.additionalProperties, currentUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(user, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrentUser {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CurrentUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CurrentUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CurrentUser is not found in the empty JSON string", CurrentUser.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CurrentUser.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `user` + User.validateJsonElement(jsonObj.get("user")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CurrentUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CurrentUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CurrentUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CurrentUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CurrentUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CurrentUser instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CurrentUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of CurrentUser + * @throws IOException if the JSON string is invalid with respect to CurrentUser + */ + public static CurrentUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CurrentUser.class); + } + + /** + * Convert an instance of CurrentUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequest.java new file mode 100644 index 00000000000..f79dc1f9d3a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequest.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * DeleteBranchProtectionRuleRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteBranchProtectionRuleRequest { + public static final String SERIALIZED_NAME_PATTERN = "pattern"; + @SerializedName(SERIALIZED_NAME_PATTERN) + private String pattern; + + public DeleteBranchProtectionRuleRequest() { + } + + public DeleteBranchProtectionRuleRequest pattern(String pattern) { + + this.pattern = pattern; + return this; + } + + /** + * Get pattern + * @return pattern + **/ + @javax.annotation.Nonnull + public String getPattern() { + return pattern; + } + + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteBranchProtectionRuleRequest instance itself + */ + public DeleteBranchProtectionRuleRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest = (DeleteBranchProtectionRuleRequest) o; + return Objects.equals(this.pattern, deleteBranchProtectionRuleRequest.pattern)&& + Objects.equals(this.additionalProperties, deleteBranchProtectionRuleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pattern, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteBranchProtectionRuleRequest {\n"); + sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pattern"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pattern"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteBranchProtectionRuleRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteBranchProtectionRuleRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteBranchProtectionRuleRequest is not found in the empty JSON string", DeleteBranchProtectionRuleRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteBranchProtectionRuleRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pattern").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pattern` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteBranchProtectionRuleRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteBranchProtectionRuleRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteBranchProtectionRuleRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteBranchProtectionRuleRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteBranchProtectionRuleRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteBranchProtectionRuleRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteBranchProtectionRuleRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteBranchProtectionRuleRequest + * @throws IOException if the JSON string is invalid with respect to DeleteBranchProtectionRuleRequest + */ + public static DeleteBranchProtectionRuleRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteBranchProtectionRuleRequest.class); + } + + /** + * Convert an instance of DeleteBranchProtectionRuleRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java new file mode 100644 index 00000000000..dd23f53b4c1 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java @@ -0,0 +1,485 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Diff + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Diff { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ADDED("added"), + + REMOVED("removed"), + + CHANGED("changed"), + + CONFLICT("conflict"), + + PREFIX_CHANGED("prefix_changed"); + + 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; + + /** + * Gets or Sets pathType + */ + @JsonAdapter(PathTypeEnum.Adapter.class) + public enum PathTypeEnum { + COMMON_PREFIX("common_prefix"), + + OBJECT("object"); + + private String value; + + PathTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PathTypeEnum fromValue(String value) { + for (PathTypeEnum b : PathTypeEnum.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 PathTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PathTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PathTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PATH_TYPE = "path_type"; + @SerializedName(SERIALIZED_NAME_PATH_TYPE) + private PathTypeEnum pathType; + + public static final String SERIALIZED_NAME_SIZE_BYTES = "size_bytes"; + @SerializedName(SERIALIZED_NAME_SIZE_BYTES) + private Long sizeBytes; + + public Diff() { + } + + public Diff type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public Diff path(String path) { + + this.path = path; + return this; + } + + /** + * Get path + * @return path + **/ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + + public Diff pathType(PathTypeEnum pathType) { + + this.pathType = pathType; + return this; + } + + /** + * Get pathType + * @return pathType + **/ + @javax.annotation.Nonnull + public PathTypeEnum getPathType() { + return pathType; + } + + + public void setPathType(PathTypeEnum pathType) { + this.pathType = pathType; + } + + + public Diff sizeBytes(Long sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * represents the size of the added/changed/deleted entry + * @return sizeBytes + **/ + @javax.annotation.Nullable + public Long getSizeBytes() { + return sizeBytes; + } + + + public void setSizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Diff instance itself + */ + public Diff putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Diff diff = (Diff) o; + return Objects.equals(this.type, diff.type) && + Objects.equals(this.path, diff.path) && + Objects.equals(this.pathType, diff.pathType) && + Objects.equals(this.sizeBytes, diff.sizeBytes)&& + Objects.equals(this.additionalProperties, diff.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, path, pathType, sizeBytes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Diff {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathType: ").append(toIndentedString(pathType)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("path"); + openapiFields.add("path_type"); + openapiFields.add("size_bytes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("path"); + openapiRequiredFields.add("path_type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Diff + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Diff.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Diff is not found in the empty JSON string", Diff.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Diff.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if (!jsonObj.get("path_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Diff.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Diff' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Diff.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Diff value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Diff read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Diff instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Diff given an JSON string + * + * @param jsonString JSON string + * @return An instance of Diff + * @throws IOException if the JSON string is invalid with respect to Diff + */ + public static Diff fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Diff.class); + } + + /** + * Convert an instance of Diff to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java new file mode 100644 index 00000000000..45feadc0c62 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Diff; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * DiffList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiffList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public DiffList() { + } + + public DiffList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public DiffList results(List results) { + + this.results = results; + return this; + } + + public DiffList addResultsItem(Diff resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DiffList instance itself + */ + public DiffList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiffList diffList = (DiffList) o; + return Objects.equals(this.pagination, diffList.pagination) && + Objects.equals(this.results, diffList.results)&& + Objects.equals(this.additionalProperties, diffList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiffList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DiffList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DiffList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiffList is not found in the empty JSON string", DiffList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DiffList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Diff.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiffList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiffList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiffList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DiffList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DiffList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiffList given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffList + * @throws IOException if the JSON string is invalid with respect to DiffList + */ + public static DiffList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffList.class); + } + + /** + * Convert an instance of DiffList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffProperties.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffProperties.java new file mode 100644 index 00000000000..0cbc4107086 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffProperties.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * DiffProperties + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiffProperties { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public DiffProperties() { + } + + public DiffProperties name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DiffProperties instance itself + */ + public DiffProperties putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiffProperties diffProperties = (DiffProperties) o; + return Objects.equals(this.name, diffProperties.name)&& + Objects.equals(this.additionalProperties, diffProperties.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiffProperties {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DiffProperties + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DiffProperties.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiffProperties is not found in the empty JSON string", DiffProperties.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DiffProperties.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiffProperties.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffProperties' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiffProperties.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiffProperties value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DiffProperties read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DiffProperties instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiffProperties given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffProperties + * @throws IOException if the JSON string is invalid with respect to DiffProperties + */ + public static DiffProperties fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffProperties.class); + } + + /** + * Convert an instance of DiffProperties to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java new file mode 100644 index 00000000000..3cda54c66cf --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Error + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Error { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public Error() { + } + + public Error message(String message) { + + this.message = message; + return this; + } + + /** + * short message explaining the error + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Error instance itself + */ + public Error putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.message, error.message)&& + Objects.equals(this.additionalProperties, error.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Error.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error + * @throws IOException if the JSON string is invalid with respect to Error + */ + public static Error fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error.class); + } + + /** + * Convert an instance of Error to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java new file mode 100644 index 00000000000..6c0e517d0cd --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java @@ -0,0 +1,321 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ErrorNoACL + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorNoACL { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NO_ACL = "no_acl"; + @SerializedName(SERIALIZED_NAME_NO_ACL) + private Boolean noAcl; + + public ErrorNoACL() { + } + + public ErrorNoACL message(String message) { + + this.message = message; + return this; + } + + /** + * short message explaining the error + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorNoACL noAcl(Boolean noAcl) { + + this.noAcl = noAcl; + return this; + } + + /** + * true if the group exists but has no ACL + * @return noAcl + **/ + @javax.annotation.Nullable + public Boolean getNoAcl() { + return noAcl; + } + + + public void setNoAcl(Boolean noAcl) { + this.noAcl = noAcl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorNoACL instance itself + */ + public ErrorNoACL putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorNoACL errorNoACL = (ErrorNoACL) o; + return Objects.equals(this.message, errorNoACL.message) && + Objects.equals(this.noAcl, errorNoACL.noAcl)&& + Objects.equals(this.additionalProperties, errorNoACL.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, noAcl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorNoACL {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" noAcl: ").append(toIndentedString(noAcl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("no_acl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorNoACL + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorNoACL.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorNoACL is not found in the empty JSON string", ErrorNoACL.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorNoACL.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorNoACL.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorNoACL' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorNoACL.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorNoACL value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorNoACL read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorNoACL instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorNoACL given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorNoACL + * @throws IOException if the JSON string is invalid with respect to ErrorNoACL + */ + public static ErrorNoACL fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorNoACL.class); + } + + /** + * Convert an instance of ErrorNoACL to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java new file mode 100644 index 00000000000..d174ca5e3bd --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java @@ -0,0 +1,357 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * FindMergeBaseResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FindMergeBaseResult { + public static final String SERIALIZED_NAME_SOURCE_COMMIT_ID = "source_commit_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_COMMIT_ID) + private String sourceCommitId; + + public static final String SERIALIZED_NAME_DESTINATION_COMMIT_ID = "destination_commit_id"; + @SerializedName(SERIALIZED_NAME_DESTINATION_COMMIT_ID) + private String destinationCommitId; + + public static final String SERIALIZED_NAME_BASE_COMMIT_ID = "base_commit_id"; + @SerializedName(SERIALIZED_NAME_BASE_COMMIT_ID) + private String baseCommitId; + + public FindMergeBaseResult() { + } + + public FindMergeBaseResult sourceCommitId(String sourceCommitId) { + + this.sourceCommitId = sourceCommitId; + return this; + } + + /** + * The commit ID of the merge source + * @return sourceCommitId + **/ + @javax.annotation.Nonnull + public String getSourceCommitId() { + return sourceCommitId; + } + + + public void setSourceCommitId(String sourceCommitId) { + this.sourceCommitId = sourceCommitId; + } + + + public FindMergeBaseResult destinationCommitId(String destinationCommitId) { + + this.destinationCommitId = destinationCommitId; + return this; + } + + /** + * The commit ID of the merge destination + * @return destinationCommitId + **/ + @javax.annotation.Nonnull + public String getDestinationCommitId() { + return destinationCommitId; + } + + + public void setDestinationCommitId(String destinationCommitId) { + this.destinationCommitId = destinationCommitId; + } + + + public FindMergeBaseResult baseCommitId(String baseCommitId) { + + this.baseCommitId = baseCommitId; + return this; + } + + /** + * The commit ID of the merge base + * @return baseCommitId + **/ + @javax.annotation.Nonnull + public String getBaseCommitId() { + return baseCommitId; + } + + + public void setBaseCommitId(String baseCommitId) { + this.baseCommitId = baseCommitId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FindMergeBaseResult instance itself + */ + public FindMergeBaseResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindMergeBaseResult findMergeBaseResult = (FindMergeBaseResult) o; + return Objects.equals(this.sourceCommitId, findMergeBaseResult.sourceCommitId) && + Objects.equals(this.destinationCommitId, findMergeBaseResult.destinationCommitId) && + Objects.equals(this.baseCommitId, findMergeBaseResult.baseCommitId)&& + Objects.equals(this.additionalProperties, findMergeBaseResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sourceCommitId, destinationCommitId, baseCommitId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindMergeBaseResult {\n"); + sb.append(" sourceCommitId: ").append(toIndentedString(sourceCommitId)).append("\n"); + sb.append(" destinationCommitId: ").append(toIndentedString(destinationCommitId)).append("\n"); + sb.append(" baseCommitId: ").append(toIndentedString(baseCommitId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("source_commit_id"); + openapiFields.add("destination_commit_id"); + openapiFields.add("base_commit_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source_commit_id"); + openapiRequiredFields.add("destination_commit_id"); + openapiRequiredFields.add("base_commit_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FindMergeBaseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FindMergeBaseResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FindMergeBaseResult is not found in the empty JSON string", FindMergeBaseResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FindMergeBaseResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("source_commit_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_commit_id").toString())); + } + if (!jsonObj.get("destination_commit_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination_commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination_commit_id").toString())); + } + if (!jsonObj.get("base_commit_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `base_commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base_commit_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FindMergeBaseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FindMergeBaseResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FindMergeBaseResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FindMergeBaseResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FindMergeBaseResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FindMergeBaseResult instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FindMergeBaseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindMergeBaseResult + * @throws IOException if the JSON string is invalid with respect to FindMergeBaseResult + */ + public static FindMergeBaseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FindMergeBaseResult.class); + } + + /** + * Convert an instance of FindMergeBaseResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java new file mode 100644 index 00000000000..0f9ac7cd479 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java @@ -0,0 +1,282 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GarbageCollectionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GarbageCollectionConfig { + public static final String SERIALIZED_NAME_GRACE_PERIOD = "grace_period"; + @SerializedName(SERIALIZED_NAME_GRACE_PERIOD) + private Integer gracePeriod; + + public GarbageCollectionConfig() { + } + + public GarbageCollectionConfig gracePeriod(Integer gracePeriod) { + + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Duration in seconds. Objects created in the recent grace_period will not be collected. + * @return gracePeriod + **/ + @javax.annotation.Nullable + public Integer getGracePeriod() { + return gracePeriod; + } + + + public void setGracePeriod(Integer gracePeriod) { + this.gracePeriod = gracePeriod; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GarbageCollectionConfig instance itself + */ + public GarbageCollectionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GarbageCollectionConfig garbageCollectionConfig = (GarbageCollectionConfig) o; + return Objects.equals(this.gracePeriod, garbageCollectionConfig.gracePeriod)&& + Objects.equals(this.additionalProperties, garbageCollectionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(gracePeriod, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GarbageCollectionConfig {\n"); + sb.append(" gracePeriod: ").append(toIndentedString(gracePeriod)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("grace_period"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GarbageCollectionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GarbageCollectionConfig is not found in the empty JSON string", GarbageCollectionConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GarbageCollectionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GarbageCollectionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GarbageCollectionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GarbageCollectionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GarbageCollectionConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GarbageCollectionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GarbageCollectionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionConfig + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionConfig + */ + public static GarbageCollectionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GarbageCollectionConfig.class); + } + + /** + * Convert an instance of GarbageCollectionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java new file mode 100644 index 00000000000..1d9b5e2b5b8 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java @@ -0,0 +1,388 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GarbageCollectionPrepareResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GarbageCollectionPrepareResponse { + public static final String SERIALIZED_NAME_RUN_ID = "run_id"; + @SerializedName(SERIALIZED_NAME_RUN_ID) + private String runId; + + public static final String SERIALIZED_NAME_GC_COMMITS_LOCATION = "gc_commits_location"; + @SerializedName(SERIALIZED_NAME_GC_COMMITS_LOCATION) + private String gcCommitsLocation; + + public static final String SERIALIZED_NAME_GC_ADDRESSES_LOCATION = "gc_addresses_location"; + @SerializedName(SERIALIZED_NAME_GC_ADDRESSES_LOCATION) + private String gcAddressesLocation; + + public static final String SERIALIZED_NAME_GC_COMMITS_PRESIGNED_URL = "gc_commits_presigned_url"; + @SerializedName(SERIALIZED_NAME_GC_COMMITS_PRESIGNED_URL) + private String gcCommitsPresignedUrl; + + public GarbageCollectionPrepareResponse() { + } + + public GarbageCollectionPrepareResponse runId(String runId) { + + this.runId = runId; + return this; + } + + /** + * a unique identifier generated for this GC job + * @return runId + **/ + @javax.annotation.Nonnull + public String getRunId() { + return runId; + } + + + public void setRunId(String runId) { + this.runId = runId; + } + + + public GarbageCollectionPrepareResponse gcCommitsLocation(String gcCommitsLocation) { + + this.gcCommitsLocation = gcCommitsLocation; + return this; + } + + /** + * location of the resulting commits csv table (partitioned by run_id) + * @return gcCommitsLocation + **/ + @javax.annotation.Nonnull + public String getGcCommitsLocation() { + return gcCommitsLocation; + } + + + public void setGcCommitsLocation(String gcCommitsLocation) { + this.gcCommitsLocation = gcCommitsLocation; + } + + + public GarbageCollectionPrepareResponse gcAddressesLocation(String gcAddressesLocation) { + + this.gcAddressesLocation = gcAddressesLocation; + return this; + } + + /** + * location to use for expired addresses parquet table (partitioned by run_id) + * @return gcAddressesLocation + **/ + @javax.annotation.Nonnull + public String getGcAddressesLocation() { + return gcAddressesLocation; + } + + + public void setGcAddressesLocation(String gcAddressesLocation) { + this.gcAddressesLocation = gcAddressesLocation; + } + + + public GarbageCollectionPrepareResponse gcCommitsPresignedUrl(String gcCommitsPresignedUrl) { + + this.gcCommitsPresignedUrl = gcCommitsPresignedUrl; + return this; + } + + /** + * a presigned url to download the commits csv + * @return gcCommitsPresignedUrl + **/ + @javax.annotation.Nullable + public String getGcCommitsPresignedUrl() { + return gcCommitsPresignedUrl; + } + + + public void setGcCommitsPresignedUrl(String gcCommitsPresignedUrl) { + this.gcCommitsPresignedUrl = gcCommitsPresignedUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GarbageCollectionPrepareResponse instance itself + */ + public GarbageCollectionPrepareResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GarbageCollectionPrepareResponse garbageCollectionPrepareResponse = (GarbageCollectionPrepareResponse) o; + return Objects.equals(this.runId, garbageCollectionPrepareResponse.runId) && + Objects.equals(this.gcCommitsLocation, garbageCollectionPrepareResponse.gcCommitsLocation) && + Objects.equals(this.gcAddressesLocation, garbageCollectionPrepareResponse.gcAddressesLocation) && + Objects.equals(this.gcCommitsPresignedUrl, garbageCollectionPrepareResponse.gcCommitsPresignedUrl)&& + Objects.equals(this.additionalProperties, garbageCollectionPrepareResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(runId, gcCommitsLocation, gcAddressesLocation, gcCommitsPresignedUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GarbageCollectionPrepareResponse {\n"); + sb.append(" runId: ").append(toIndentedString(runId)).append("\n"); + sb.append(" gcCommitsLocation: ").append(toIndentedString(gcCommitsLocation)).append("\n"); + sb.append(" gcAddressesLocation: ").append(toIndentedString(gcAddressesLocation)).append("\n"); + sb.append(" gcCommitsPresignedUrl: ").append(toIndentedString(gcCommitsPresignedUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("run_id"); + openapiFields.add("gc_commits_location"); + openapiFields.add("gc_addresses_location"); + openapiFields.add("gc_commits_presigned_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("run_id"); + openapiRequiredFields.add("gc_commits_location"); + openapiRequiredFields.add("gc_addresses_location"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionPrepareResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GarbageCollectionPrepareResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GarbageCollectionPrepareResponse is not found in the empty JSON string", GarbageCollectionPrepareResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GarbageCollectionPrepareResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("run_id").toString())); + } + if (!jsonObj.get("gc_commits_location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gc_commits_location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gc_commits_location").toString())); + } + if (!jsonObj.get("gc_addresses_location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gc_addresses_location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gc_addresses_location").toString())); + } + if ((jsonObj.get("gc_commits_presigned_url") != null && !jsonObj.get("gc_commits_presigned_url").isJsonNull()) && !jsonObj.get("gc_commits_presigned_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gc_commits_presigned_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gc_commits_presigned_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GarbageCollectionPrepareResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GarbageCollectionPrepareResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GarbageCollectionPrepareResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GarbageCollectionPrepareResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GarbageCollectionPrepareResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GarbageCollectionPrepareResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GarbageCollectionPrepareResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionPrepareResponse + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionPrepareResponse + */ + public static GarbageCollectionPrepareResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GarbageCollectionPrepareResponse.class); + } + + /** + * Convert an instance of GarbageCollectionPrepareResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java new file mode 100644 index 00000000000..8e8ea5c6340 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java @@ -0,0 +1,322 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GarbageCollectionRule + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GarbageCollectionRule { + public static final String SERIALIZED_NAME_BRANCH_ID = "branch_id"; + @SerializedName(SERIALIZED_NAME_BRANCH_ID) + private String branchId; + + public static final String SERIALIZED_NAME_RETENTION_DAYS = "retention_days"; + @SerializedName(SERIALIZED_NAME_RETENTION_DAYS) + private Integer retentionDays; + + public GarbageCollectionRule() { + } + + public GarbageCollectionRule branchId(String branchId) { + + this.branchId = branchId; + return this; + } + + /** + * Get branchId + * @return branchId + **/ + @javax.annotation.Nonnull + public String getBranchId() { + return branchId; + } + + + public void setBranchId(String branchId) { + this.branchId = branchId; + } + + + public GarbageCollectionRule retentionDays(Integer retentionDays) { + + this.retentionDays = retentionDays; + return this; + } + + /** + * Get retentionDays + * @return retentionDays + **/ + @javax.annotation.Nonnull + public Integer getRetentionDays() { + return retentionDays; + } + + + public void setRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GarbageCollectionRule instance itself + */ + public GarbageCollectionRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GarbageCollectionRule garbageCollectionRule = (GarbageCollectionRule) o; + return Objects.equals(this.branchId, garbageCollectionRule.branchId) && + Objects.equals(this.retentionDays, garbageCollectionRule.retentionDays)&& + Objects.equals(this.additionalProperties, garbageCollectionRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(branchId, retentionDays, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GarbageCollectionRule {\n"); + sb.append(" branchId: ").append(toIndentedString(branchId)).append("\n"); + sb.append(" retentionDays: ").append(toIndentedString(retentionDays)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("branch_id"); + openapiFields.add("retention_days"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("branch_id"); + openapiRequiredFields.add("retention_days"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GarbageCollectionRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GarbageCollectionRule is not found in the empty JSON string", GarbageCollectionRule.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GarbageCollectionRule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("branch_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branch_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GarbageCollectionRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GarbageCollectionRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GarbageCollectionRule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GarbageCollectionRule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GarbageCollectionRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GarbageCollectionRule instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GarbageCollectionRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionRule + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRule + */ + public static GarbageCollectionRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GarbageCollectionRule.class); + } + + /** + * Convert an instance of GarbageCollectionRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java new file mode 100644 index 00000000000..da7377b32bf --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java @@ -0,0 +1,340 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.GarbageCollectionRule; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GarbageCollectionRules + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GarbageCollectionRules { + public static final String SERIALIZED_NAME_DEFAULT_RETENTION_DAYS = "default_retention_days"; + @SerializedName(SERIALIZED_NAME_DEFAULT_RETENTION_DAYS) + private Integer defaultRetentionDays; + + public static final String SERIALIZED_NAME_BRANCHES = "branches"; + @SerializedName(SERIALIZED_NAME_BRANCHES) + private List branches = new ArrayList<>(); + + public GarbageCollectionRules() { + } + + public GarbageCollectionRules defaultRetentionDays(Integer defaultRetentionDays) { + + this.defaultRetentionDays = defaultRetentionDays; + return this; + } + + /** + * Get defaultRetentionDays + * @return defaultRetentionDays + **/ + @javax.annotation.Nonnull + public Integer getDefaultRetentionDays() { + return defaultRetentionDays; + } + + + public void setDefaultRetentionDays(Integer defaultRetentionDays) { + this.defaultRetentionDays = defaultRetentionDays; + } + + + public GarbageCollectionRules branches(List branches) { + + this.branches = branches; + return this; + } + + public GarbageCollectionRules addBranchesItem(GarbageCollectionRule branchesItem) { + if (this.branches == null) { + this.branches = new ArrayList<>(); + } + this.branches.add(branchesItem); + return this; + } + + /** + * Get branches + * @return branches + **/ + @javax.annotation.Nonnull + public List getBranches() { + return branches; + } + + + public void setBranches(List branches) { + this.branches = branches; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GarbageCollectionRules instance itself + */ + public GarbageCollectionRules putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GarbageCollectionRules garbageCollectionRules = (GarbageCollectionRules) o; + return Objects.equals(this.defaultRetentionDays, garbageCollectionRules.defaultRetentionDays) && + Objects.equals(this.branches, garbageCollectionRules.branches)&& + Objects.equals(this.additionalProperties, garbageCollectionRules.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultRetentionDays, branches, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GarbageCollectionRules {\n"); + sb.append(" defaultRetentionDays: ").append(toIndentedString(defaultRetentionDays)).append("\n"); + sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("default_retention_days"); + openapiFields.add("branches"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("default_retention_days"); + openapiRequiredFields.add("branches"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRules + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GarbageCollectionRules.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GarbageCollectionRules is not found in the empty JSON string", GarbageCollectionRules.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GarbageCollectionRules.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("branches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `branches` to be an array in the JSON string but got `%s`", jsonObj.get("branches").toString())); + } + + JsonArray jsonArraybranches = jsonObj.getAsJsonArray("branches"); + // validate the required field `branches` (array) + for (int i = 0; i < jsonArraybranches.size(); i++) { + GarbageCollectionRule.validateJsonElement(jsonArraybranches.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GarbageCollectionRules.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GarbageCollectionRules' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GarbageCollectionRules.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GarbageCollectionRules value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GarbageCollectionRules read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GarbageCollectionRules instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GarbageCollectionRules given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionRules + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRules + */ + public static GarbageCollectionRules fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GarbageCollectionRules.class); + } + + /** + * Convert an instance of GarbageCollectionRules to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java new file mode 100644 index 00000000000..d74a412aa11 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java @@ -0,0 +1,322 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Group + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Group { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public Group() { + } + + public Group id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Group creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Group instance itself + */ + public Group putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Group group = (Group) o; + return Objects.equals(this.id, group.id) && + Objects.equals(this.creationDate, group.creationDate)&& + Objects.equals(this.additionalProperties, group.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Group {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("creation_date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("creation_date"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Group + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Group.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Group is not found in the empty JSON string", Group.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Group.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Group.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Group' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Group.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Group value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Group read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Group instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Group given an JSON string + * + * @param jsonString JSON string + * @return An instance of Group + * @throws IOException if the JSON string is invalid with respect to Group + */ + public static Group fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Group.class); + } + + /** + * Convert an instance of Group to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java new file mode 100644 index 00000000000..3335e126308 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GroupCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GroupCreation { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public GroupCreation() { + } + + public GroupCreation id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GroupCreation instance itself + */ + public GroupCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupCreation groupCreation = (GroupCreation) o; + return Objects.equals(this.id, groupCreation.id)&& + Objects.equals(this.additionalProperties, groupCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupCreation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupCreation is not found in the empty JSON string", GroupCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GroupCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreation + * @throws IOException if the JSON string is invalid with respect to GroupCreation + */ + public static GroupCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupCreation.class); + } + + /** + * Convert an instance of GroupCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java new file mode 100644 index 00000000000..195d2cf0835 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Group; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * GroupList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GroupList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public GroupList() { + } + + public GroupList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public GroupList results(List results) { + + this.results = results; + return this; + } + + public GroupList addResultsItem(Group resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GroupList instance itself + */ + public GroupList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupList groupList = (GroupList) o; + return Objects.equals(this.pagination, groupList.pagination) && + Objects.equals(this.results, groupList.results)&& + Objects.equals(this.additionalProperties, groupList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupList is not found in the empty JSON string", GroupList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Group.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GroupList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupList given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupList + * @throws IOException if the JSON string is invalid with respect to GroupList + */ + public static GroupList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupList.class); + } + + /** + * Convert an instance of GroupList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java new file mode 100644 index 00000000000..efd6feb4a9d --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java @@ -0,0 +1,494 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * HookRun + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HookRun { + public static final String SERIALIZED_NAME_HOOK_RUN_ID = "hook_run_id"; + @SerializedName(SERIALIZED_NAME_HOOK_RUN_ID) + private String hookRunId; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_HOOK_ID = "hook_id"; + @SerializedName(SERIALIZED_NAME_HOOK_ID) + private String hookId; + + public static final String SERIALIZED_NAME_START_TIME = "start_time"; + @SerializedName(SERIALIZED_NAME_START_TIME) + private OffsetDateTime startTime; + + public static final String SERIALIZED_NAME_END_TIME = "end_time"; + @SerializedName(SERIALIZED_NAME_END_TIME) + private OffsetDateTime endTime; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + FAILED("failed"), + + COMPLETED("completed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.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 StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public HookRun() { + } + + public HookRun hookRunId(String hookRunId) { + + this.hookRunId = hookRunId; + return this; + } + + /** + * Get hookRunId + * @return hookRunId + **/ + @javax.annotation.Nonnull + public String getHookRunId() { + return hookRunId; + } + + + public void setHookRunId(String hookRunId) { + this.hookRunId = hookRunId; + } + + + public HookRun action(String action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nonnull + public String getAction() { + return action; + } + + + public void setAction(String action) { + this.action = action; + } + + + public HookRun hookId(String hookId) { + + this.hookId = hookId; + return this; + } + + /** + * Get hookId + * @return hookId + **/ + @javax.annotation.Nonnull + public String getHookId() { + return hookId; + } + + + public void setHookId(String hookId) { + this.hookId = hookId; + } + + + public HookRun startTime(OffsetDateTime startTime) { + + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getStartTime() { + return startTime; + } + + + public void setStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + } + + + public HookRun endTime(OffsetDateTime endTime) { + + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + **/ + @javax.annotation.Nullable + public OffsetDateTime getEndTime() { + return endTime; + } + + + public void setEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + } + + + public HookRun status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HookRun instance itself + */ + public HookRun putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HookRun hookRun = (HookRun) o; + return Objects.equals(this.hookRunId, hookRun.hookRunId) && + Objects.equals(this.action, hookRun.action) && + Objects.equals(this.hookId, hookRun.hookId) && + Objects.equals(this.startTime, hookRun.startTime) && + Objects.equals(this.endTime, hookRun.endTime) && + Objects.equals(this.status, hookRun.status)&& + Objects.equals(this.additionalProperties, hookRun.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hookRunId, action, hookId, startTime, endTime, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HookRun {\n"); + sb.append(" hookRunId: ").append(toIndentedString(hookRunId)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" hookId: ").append(toIndentedString(hookId)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hook_run_id"); + openapiFields.add("action"); + openapiFields.add("hook_id"); + openapiFields.add("start_time"); + openapiFields.add("end_time"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hook_run_id"); + openapiRequiredFields.add("action"); + openapiRequiredFields.add("hook_id"); + openapiRequiredFields.add("start_time"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HookRun + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HookRun.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HookRun is not found in the empty JSON string", HookRun.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HookRun.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("hook_run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hook_run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hook_run_id").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + if (!jsonObj.get("hook_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hook_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hook_id").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HookRun.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HookRun' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HookRun.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HookRun value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public HookRun read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + HookRun instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HookRun given an JSON string + * + * @param jsonString JSON string + * @return An instance of HookRun + * @throws IOException if the JSON string is invalid with respect to HookRun + */ + public static HookRun fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HookRun.class); + } + + /** + * Convert an instance of HookRun to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java new file mode 100644 index 00000000000..ce14d7a908e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.HookRun; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * HookRunList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HookRunList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public HookRunList() { + } + + public HookRunList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public HookRunList results(List results) { + + this.results = results; + return this; + } + + public HookRunList addResultsItem(HookRun resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HookRunList instance itself + */ + public HookRunList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HookRunList hookRunList = (HookRunList) o; + return Objects.equals(this.pagination, hookRunList.pagination) && + Objects.equals(this.results, hookRunList.results)&& + Objects.equals(this.additionalProperties, hookRunList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HookRunList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HookRunList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HookRunList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HookRunList is not found in the empty JSON string", HookRunList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HookRunList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + HookRun.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HookRunList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HookRunList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HookRunList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HookRunList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public HookRunList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + HookRunList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HookRunList given an JSON string + * + * @param jsonString JSON string + * @return An instance of HookRunList + * @throws IOException if the JSON string is invalid with respect to HookRunList + */ + public static HookRunList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HookRunList.class); + } + + /** + * Convert an instance of HookRunList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java new file mode 100644 index 00000000000..90488268258 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.CommitCreation; +import io.lakefs.clients.sdk.model.ImportLocation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ImportCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ImportCreation { + public static final String SERIALIZED_NAME_PATHS = "paths"; + @SerializedName(SERIALIZED_NAME_PATHS) + private List paths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COMMIT = "commit"; + @SerializedName(SERIALIZED_NAME_COMMIT) + private CommitCreation commit; + + public ImportCreation() { + } + + public ImportCreation paths(List paths) { + + this.paths = paths; + return this; + } + + public ImportCreation addPathsItem(ImportLocation pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * Get paths + * @return paths + **/ + @javax.annotation.Nonnull + public List getPaths() { + return paths; + } + + + public void setPaths(List paths) { + this.paths = paths; + } + + + public ImportCreation commit(CommitCreation commit) { + + this.commit = commit; + return this; + } + + /** + * Get commit + * @return commit + **/ + @javax.annotation.Nonnull + public CommitCreation getCommit() { + return commit; + } + + + public void setCommit(CommitCreation commit) { + this.commit = commit; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ImportCreation instance itself + */ + public ImportCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImportCreation importCreation = (ImportCreation) o; + return Objects.equals(this.paths, importCreation.paths) && + Objects.equals(this.commit, importCreation.commit)&& + Objects.equals(this.additionalProperties, importCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(paths, commit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImportCreation {\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append(" commit: ").append(toIndentedString(commit)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("paths"); + openapiFields.add("commit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("paths"); + openapiRequiredFields.add("commit"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ImportCreation is not found in the empty JSON string", ImportCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("paths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `paths` to be an array in the JSON string but got `%s`", jsonObj.get("paths").toString())); + } + + JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); + // validate the required field `paths` (array) + for (int i = 0; i < jsonArraypaths.size(); i++) { + ImportLocation.validateJsonElement(jsonArraypaths.get(i)); + }; + // validate the required field `commit` + CommitCreation.validateJsonElement(jsonObj.get("commit")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImportCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ImportCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ImportCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportCreation + * @throws IOException if the JSON string is invalid with respect to ImportCreation + */ + public static ImportCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportCreation.class); + } + + /** + * Convert an instance of ImportCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java new file mode 100644 index 00000000000..5a71cdc3322 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ImportCreationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ImportCreationResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public ImportCreationResponse() { + } + + public ImportCreationResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the import process + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ImportCreationResponse instance itself + */ + public ImportCreationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImportCreationResponse importCreationResponse = (ImportCreationResponse) o; + return Objects.equals(this.id, importCreationResponse.id)&& + Objects.equals(this.additionalProperties, importCreationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImportCreationResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportCreationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportCreationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ImportCreationResponse is not found in the empty JSON string", ImportCreationResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportCreationResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImportCreationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportCreationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportCreationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportCreationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ImportCreationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportCreationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ImportCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportCreationResponse + * @throws IOException if the JSON string is invalid with respect to ImportCreationResponse + */ + public static ImportCreationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportCreationResponse.class); + } + + /** + * Convert an instance of ImportCreationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java new file mode 100644 index 00000000000..aaa6ee29aab --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java @@ -0,0 +1,404 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * 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() { + } + + public ImportLocation type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Path type, can either be 'common_prefix' or 'object' + * @return type + **/ + @javax.annotation.Nonnull + 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 import path or to a single object. Must match the lakeFS installation blockstore type. + * @return path + **/ + @javax.annotation.Nonnull + 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 + * @return destination + **/ + @javax.annotation.Nonnull + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ImportLocation instance itself + */ + public ImportLocation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, importLocation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, path, destination, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("path"); + openapiFields.add("destination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("path"); + openapiRequiredFields.add("destination"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportLocation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportLocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ImportLocation is not found in the empty JSON string", ImportLocation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportLocation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if (!jsonObj.get("destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImportLocation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportLocation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportLocation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportLocation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ImportLocation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportLocation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ImportLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportLocation + * @throws IOException if the JSON string is invalid with respect to ImportLocation + */ + public static ImportLocation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportLocation.class); + } + + /** + * Convert an instance of ImportLocation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java new file mode 100644 index 00000000000..7b62adbc436 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java @@ -0,0 +1,445 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ImportStatus + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ImportStatus { + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Boolean completed; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private OffsetDateTime updateTime; + + public static final String SERIALIZED_NAME_INGESTED_OBJECTS = "ingested_objects"; + @SerializedName(SERIALIZED_NAME_INGESTED_OBJECTS) + private Long ingestedObjects; + + public static final String SERIALIZED_NAME_METARANGE_ID = "metarange_id"; + @SerializedName(SERIALIZED_NAME_METARANGE_ID) + private String metarangeId; + + public static final String SERIALIZED_NAME_COMMIT = "commit"; + @SerializedName(SERIALIZED_NAME_COMMIT) + private Commit commit; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private Error error; + + public ImportStatus() { + } + + public ImportStatus completed(Boolean completed) { + + this.completed = completed; + return this; + } + + /** + * Get completed + * @return completed + **/ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + + public ImportStatus updateTime(OffsetDateTime updateTime) { + + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * @return updateTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(OffsetDateTime updateTime) { + this.updateTime = updateTime; + } + + + public ImportStatus ingestedObjects(Long ingestedObjects) { + + this.ingestedObjects = ingestedObjects; + return this; + } + + /** + * Number of objects processed so far + * @return ingestedObjects + **/ + @javax.annotation.Nullable + public Long getIngestedObjects() { + return ingestedObjects; + } + + + public void setIngestedObjects(Long ingestedObjects) { + this.ingestedObjects = ingestedObjects; + } + + + public ImportStatus metarangeId(String metarangeId) { + + this.metarangeId = metarangeId; + return this; + } + + /** + * Get metarangeId + * @return metarangeId + **/ + @javax.annotation.Nullable + public String getMetarangeId() { + return metarangeId; + } + + + public void setMetarangeId(String metarangeId) { + this.metarangeId = metarangeId; + } + + + public ImportStatus commit(Commit commit) { + + this.commit = commit; + return this; + } + + /** + * Get commit + * @return commit + **/ + @javax.annotation.Nullable + public Commit getCommit() { + return commit; + } + + + public void setCommit(Commit commit) { + this.commit = commit; + } + + + public ImportStatus error(Error error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public Error getError() { + return error; + } + + + public void setError(Error error) { + this.error = error; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ImportStatus instance itself + */ + public ImportStatus putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImportStatus importStatus = (ImportStatus) o; + return Objects.equals(this.completed, importStatus.completed) && + Objects.equals(this.updateTime, importStatus.updateTime) && + Objects.equals(this.ingestedObjects, importStatus.ingestedObjects) && + Objects.equals(this.metarangeId, importStatus.metarangeId) && + Objects.equals(this.commit, importStatus.commit) && + Objects.equals(this.error, importStatus.error)&& + Objects.equals(this.additionalProperties, importStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(completed, updateTime, ingestedObjects, metarangeId, commit, error, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImportStatus {\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" ingestedObjects: ").append(toIndentedString(ingestedObjects)).append("\n"); + sb.append(" metarangeId: ").append(toIndentedString(metarangeId)).append("\n"); + sb.append(" commit: ").append(toIndentedString(commit)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("completed"); + openapiFields.add("update_time"); + openapiFields.add("ingested_objects"); + openapiFields.add("metarange_id"); + openapiFields.add("commit"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("completed"); + openapiRequiredFields.add("update_time"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImportStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ImportStatus is not found in the empty JSON string", ImportStatus.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImportStatus.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("metarange_id") != null && !jsonObj.get("metarange_id").isJsonNull()) && !jsonObj.get("metarange_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metarange_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metarange_id").toString())); + } + // validate the optional field `commit` + if (jsonObj.get("commit") != null && !jsonObj.get("commit").isJsonNull()) { + Commit.validateJsonElement(jsonObj.get("commit")); + } + // validate the optional field `error` + if (jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) { + Error.validateJsonElement(jsonObj.get("error")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImportStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImportStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ImportStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ImportStatus value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ImportStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImportStatus instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ImportStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportStatus + * @throws IOException if the JSON string is invalid with respect to ImportStatus + */ + public static ImportStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImportStatus.class); + } + + /** + * Convert an instance of ImportStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java new file mode 100644 index 00000000000..a564a207079 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java @@ -0,0 +1,541 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * LoginConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LoginConfig { + /** + * RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. + */ + @JsonAdapter(RBACEnum.Adapter.class) + public enum RBACEnum { + SIMPLIFIED("simplified"), + + EXTERNAL("external"); + + private String value; + + RBACEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RBACEnum fromValue(String value) { + for (RBACEnum b : RBACEnum.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 RBACEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RBACEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RBACEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_R_B_A_C = "RBAC"; + @SerializedName(SERIALIZED_NAME_R_B_A_C) + private RBACEnum RBAC; + + public static final String SERIALIZED_NAME_LOGIN_URL = "login_url"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + private String loginUrl; + + public static final String SERIALIZED_NAME_LOGIN_FAILED_MESSAGE = "login_failed_message"; + @SerializedName(SERIALIZED_NAME_LOGIN_FAILED_MESSAGE) + private String loginFailedMessage; + + public static final String SERIALIZED_NAME_FALLBACK_LOGIN_URL = "fallback_login_url"; + @SerializedName(SERIALIZED_NAME_FALLBACK_LOGIN_URL) + private String fallbackLoginUrl; + + public static final String SERIALIZED_NAME_FALLBACK_LOGIN_LABEL = "fallback_login_label"; + @SerializedName(SERIALIZED_NAME_FALLBACK_LOGIN_LABEL) + private String fallbackLoginLabel; + + public static final String SERIALIZED_NAME_LOGIN_COOKIE_NAMES = "login_cookie_names"; + @SerializedName(SERIALIZED_NAME_LOGIN_COOKIE_NAMES) + private List loginCookieNames = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOGOUT_URL = "logout_url"; + @SerializedName(SERIALIZED_NAME_LOGOUT_URL) + private String logoutUrl; + + public LoginConfig() { + } + + public LoginConfig RBAC(RBACEnum RBAC) { + + this.RBAC = RBAC; + return this; + } + + /** + * RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. + * @return RBAC + **/ + @javax.annotation.Nullable + public RBACEnum getRBAC() { + return RBAC; + } + + + public void setRBAC(RBACEnum RBAC) { + this.RBAC = RBAC; + } + + + public LoginConfig loginUrl(String loginUrl) { + + this.loginUrl = loginUrl; + return this; + } + + /** + * primary URL to use for login. + * @return loginUrl + **/ + @javax.annotation.Nonnull + public String getLoginUrl() { + return loginUrl; + } + + + public void setLoginUrl(String loginUrl) { + this.loginUrl = loginUrl; + } + + + public LoginConfig loginFailedMessage(String loginFailedMessage) { + + this.loginFailedMessage = loginFailedMessage; + return this; + } + + /** + * message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method + * @return loginFailedMessage + **/ + @javax.annotation.Nullable + public String getLoginFailedMessage() { + return loginFailedMessage; + } + + + public void setLoginFailedMessage(String loginFailedMessage) { + this.loginFailedMessage = loginFailedMessage; + } + + + public LoginConfig fallbackLoginUrl(String fallbackLoginUrl) { + + this.fallbackLoginUrl = fallbackLoginUrl; + return this; + } + + /** + * secondary URL to offer users to use for login. + * @return fallbackLoginUrl + **/ + @javax.annotation.Nullable + public String getFallbackLoginUrl() { + return fallbackLoginUrl; + } + + + public void setFallbackLoginUrl(String fallbackLoginUrl) { + this.fallbackLoginUrl = fallbackLoginUrl; + } + + + public LoginConfig fallbackLoginLabel(String fallbackLoginLabel) { + + this.fallbackLoginLabel = fallbackLoginLabel; + return this; + } + + /** + * label to place on fallback_login_url. + * @return fallbackLoginLabel + **/ + @javax.annotation.Nullable + public String getFallbackLoginLabel() { + return fallbackLoginLabel; + } + + + public void setFallbackLoginLabel(String fallbackLoginLabel) { + this.fallbackLoginLabel = fallbackLoginLabel; + } + + + public LoginConfig loginCookieNames(List loginCookieNames) { + + this.loginCookieNames = loginCookieNames; + return this; + } + + public LoginConfig addLoginCookieNamesItem(String loginCookieNamesItem) { + if (this.loginCookieNames == null) { + this.loginCookieNames = new ArrayList<>(); + } + this.loginCookieNames.add(loginCookieNamesItem); + return this; + } + + /** + * cookie names used to store JWT + * @return loginCookieNames + **/ + @javax.annotation.Nonnull + public List getLoginCookieNames() { + return loginCookieNames; + } + + + public void setLoginCookieNames(List loginCookieNames) { + this.loginCookieNames = loginCookieNames; + } + + + public LoginConfig logoutUrl(String logoutUrl) { + + this.logoutUrl = logoutUrl; + return this; + } + + /** + * URL to use for logging out. + * @return logoutUrl + **/ + @javax.annotation.Nonnull + public String getLogoutUrl() { + return logoutUrl; + } + + + public void setLogoutUrl(String logoutUrl) { + this.logoutUrl = logoutUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginConfig instance itself + */ + public LoginConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginConfig loginConfig = (LoginConfig) o; + return Objects.equals(this.RBAC, loginConfig.RBAC) && + Objects.equals(this.loginUrl, loginConfig.loginUrl) && + Objects.equals(this.loginFailedMessage, loginConfig.loginFailedMessage) && + Objects.equals(this.fallbackLoginUrl, loginConfig.fallbackLoginUrl) && + Objects.equals(this.fallbackLoginLabel, loginConfig.fallbackLoginLabel) && + Objects.equals(this.loginCookieNames, loginConfig.loginCookieNames) && + Objects.equals(this.logoutUrl, loginConfig.logoutUrl)&& + Objects.equals(this.additionalProperties, loginConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(RBAC, loginUrl, loginFailedMessage, fallbackLoginUrl, fallbackLoginLabel, loginCookieNames, logoutUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginConfig {\n"); + sb.append(" RBAC: ").append(toIndentedString(RBAC)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" loginFailedMessage: ").append(toIndentedString(loginFailedMessage)).append("\n"); + sb.append(" fallbackLoginUrl: ").append(toIndentedString(fallbackLoginUrl)).append("\n"); + sb.append(" fallbackLoginLabel: ").append(toIndentedString(fallbackLoginLabel)).append("\n"); + sb.append(" loginCookieNames: ").append(toIndentedString(loginCookieNames)).append("\n"); + sb.append(" logoutUrl: ").append(toIndentedString(logoutUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("RBAC"); + openapiFields.add("login_url"); + openapiFields.add("login_failed_message"); + openapiFields.add("fallback_login_url"); + openapiFields.add("fallback_login_label"); + openapiFields.add("login_cookie_names"); + openapiFields.add("logout_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("login_url"); + openapiRequiredFields.add("login_cookie_names"); + openapiRequiredFields.add("logout_url"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LoginConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginConfig is not found in the empty JSON string", LoginConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("RBAC") != null && !jsonObj.get("RBAC").isJsonNull()) && !jsonObj.get("RBAC").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RBAC` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RBAC").toString())); + } + if (!jsonObj.get("login_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `login_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("login_url").toString())); + } + if ((jsonObj.get("login_failed_message") != null && !jsonObj.get("login_failed_message").isJsonNull()) && !jsonObj.get("login_failed_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `login_failed_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("login_failed_message").toString())); + } + if ((jsonObj.get("fallback_login_url") != null && !jsonObj.get("fallback_login_url").isJsonNull()) && !jsonObj.get("fallback_login_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fallback_login_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallback_login_url").toString())); + } + if ((jsonObj.get("fallback_login_label") != null && !jsonObj.get("fallback_login_label").isJsonNull()) && !jsonObj.get("fallback_login_label").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fallback_login_label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallback_login_label").toString())); + } + // ensure the required json array is present + if (jsonObj.get("login_cookie_names") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("login_cookie_names").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `login_cookie_names` to be an array in the JSON string but got `%s`", jsonObj.get("login_cookie_names").toString())); + } + if (!jsonObj.get("logout_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logout_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logout_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LoginConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LoginConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginConfig + * @throws IOException if the JSON string is invalid with respect to LoginConfig + */ + public static LoginConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginConfig.class); + } + + /** + * Convert an instance of LoginConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java new file mode 100644 index 00000000000..f91aa52d498 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java @@ -0,0 +1,325 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * LoginInformation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LoginInformation { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + private String secretAccessKey; + + public LoginInformation() { + } + + public LoginInformation accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get accessKeyId + * @return accessKeyId + **/ + @javax.annotation.Nonnull + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public LoginInformation secretAccessKey(String secretAccessKey) { + + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * Get secretAccessKey + * @return secretAccessKey + **/ + @javax.annotation.Nonnull + public String getSecretAccessKey() { + return secretAccessKey; + } + + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginInformation instance itself + */ + public LoginInformation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginInformation loginInformation = (LoginInformation) o; + return Objects.equals(this.accessKeyId, loginInformation.accessKeyId) && + Objects.equals(this.secretAccessKey, loginInformation.secretAccessKey)&& + Objects.equals(this.additionalProperties, loginInformation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginInformation {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("secret_access_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("access_key_id"); + openapiRequiredFields.add("secret_access_key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LoginInformation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginInformation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginInformation is not found in the empty JSON string", LoginInformation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginInformation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + if (!jsonObj.get("secret_access_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret_access_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_access_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LoginInformation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginInformation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginInformation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LoginInformation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginInformation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginInformation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginInformation given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginInformation + * @throws IOException if the JSON string is invalid with respect to LoginInformation + */ + public static LoginInformation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginInformation.class); + } + + /** + * Convert an instance of LoginInformation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java new file mode 100644 index 00000000000..bd323e0a72b --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java @@ -0,0 +1,354 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Merge + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Merge { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private String strategy; + + public Merge() { + } + + public Merge message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public Merge metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public Merge putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public Merge strategy(String strategy) { + + this.strategy = strategy; + return this; + } + + /** + * In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict + * @return strategy + **/ + @javax.annotation.Nullable + public String getStrategy() { + return strategy; + } + + + public void setStrategy(String strategy) { + this.strategy = strategy; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Merge instance itself + */ + public Merge putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Merge merge = (Merge) o; + return Objects.equals(this.message, merge.message) && + Objects.equals(this.metadata, merge.metadata) && + Objects.equals(this.strategy, merge.strategy)&& + Objects.equals(this.additionalProperties, merge.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, metadata, strategy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Merge {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("metadata"); + openapiFields.add("strategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Merge + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Merge.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Merge is not found in the empty JSON string", Merge.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("strategy") != null && !jsonObj.get("strategy").isJsonNull()) && !jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `strategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strategy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Merge.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Merge' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Merge.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Merge value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Merge read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Merge instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Merge given an JSON string + * + * @param jsonString JSON string + * @return An instance of Merge + * @throws IOException if the JSON string is invalid with respect to Merge + */ + public static Merge fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Merge.class); + } + + /** + * Convert an instance of Merge to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java new file mode 100644 index 00000000000..6bb6c0ce51c --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * MergeResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MergeResult { + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public MergeResult() { + } + + public MergeResult reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Get reference + * @return reference + **/ + @javax.annotation.Nonnull + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MergeResult instance itself + */ + public MergeResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeResult mergeResult = (MergeResult) o; + return Objects.equals(this.reference, mergeResult.reference)&& + Objects.equals(this.additionalProperties, mergeResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reference, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeResult {\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reference"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MergeResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MergeResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MergeResult is not found in the empty JSON string", MergeResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MergeResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MergeResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MergeResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MergeResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MergeResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MergeResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MergeResult instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MergeResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of MergeResult + * @throws IOException if the JSON string is invalid with respect to MergeResult + */ + public static MergeResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MergeResult.class); + } + + /** + * Convert an instance of MergeResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java new file mode 100644 index 00000000000..300b183c2e2 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java @@ -0,0 +1,311 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.RangeMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * MetaRangeCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MetaRangeCreation { + public static final String SERIALIZED_NAME_RANGES = "ranges"; + @SerializedName(SERIALIZED_NAME_RANGES) + private List ranges = new ArrayList<>(); + + public MetaRangeCreation() { + } + + public MetaRangeCreation ranges(List ranges) { + + this.ranges = ranges; + return this; + } + + public MetaRangeCreation addRangesItem(RangeMetadata rangesItem) { + if (this.ranges == null) { + this.ranges = new ArrayList<>(); + } + this.ranges.add(rangesItem); + return this; + } + + /** + * Get ranges + * @return ranges + **/ + @javax.annotation.Nonnull + public List getRanges() { + return ranges; + } + + + public void setRanges(List ranges) { + this.ranges = ranges; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MetaRangeCreation instance itself + */ + public MetaRangeCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetaRangeCreation metaRangeCreation = (MetaRangeCreation) o; + return Objects.equals(this.ranges, metaRangeCreation.ranges)&& + Objects.equals(this.additionalProperties, metaRangeCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ranges, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetaRangeCreation {\n"); + sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ranges"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ranges"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MetaRangeCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MetaRangeCreation is not found in the empty JSON string", MetaRangeCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MetaRangeCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + } + + JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); + // validate the required field `ranges` (array) + for (int i = 0; i < jsonArrayranges.size(); i++) { + RangeMetadata.validateJsonElement(jsonArrayranges.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MetaRangeCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetaRangeCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MetaRangeCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MetaRangeCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MetaRangeCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MetaRangeCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MetaRangeCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetaRangeCreation + * @throws IOException if the JSON string is invalid with respect to MetaRangeCreation + */ + public static MetaRangeCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetaRangeCreation.class); + } + + /** + * Convert an instance of MetaRangeCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java new file mode 100644 index 00000000000..3047fc2b08f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java @@ -0,0 +1,285 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * MetaRangeCreationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MetaRangeCreationResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public MetaRangeCreationResponse() { + } + + public MetaRangeCreationResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the created metarange + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MetaRangeCreationResponse instance itself + */ + public MetaRangeCreationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetaRangeCreationResponse metaRangeCreationResponse = (MetaRangeCreationResponse) o; + return Objects.equals(this.id, metaRangeCreationResponse.id)&& + Objects.equals(this.additionalProperties, metaRangeCreationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetaRangeCreationResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MetaRangeCreationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MetaRangeCreationResponse is not found in the empty JSON string", MetaRangeCreationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MetaRangeCreationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetaRangeCreationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MetaRangeCreationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MetaRangeCreationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MetaRangeCreationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MetaRangeCreationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MetaRangeCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetaRangeCreationResponse + * @throws IOException if the JSON string is invalid with respect to MetaRangeCreationResponse + */ + public static MetaRangeCreationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetaRangeCreationResponse.class); + } + + /** + * Convert an instance of MetaRangeCreationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/OTFDiffs.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OTFDiffs.java new file mode 100644 index 00000000000..4ccf3ad46df --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OTFDiffs.java @@ -0,0 +1,307 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.DiffProperties; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * OTFDiffs + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OTFDiffs { + public static final String SERIALIZED_NAME_DIFFS = "diffs"; + @SerializedName(SERIALIZED_NAME_DIFFS) + private List diffs; + + public OTFDiffs() { + } + + public OTFDiffs diffs(List diffs) { + + this.diffs = diffs; + return this; + } + + public OTFDiffs addDiffsItem(DiffProperties diffsItem) { + if (this.diffs == null) { + this.diffs = new ArrayList<>(); + } + this.diffs.add(diffsItem); + return this; + } + + /** + * Get diffs + * @return diffs + **/ + @javax.annotation.Nullable + public List getDiffs() { + return diffs; + } + + + public void setDiffs(List diffs) { + this.diffs = diffs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OTFDiffs instance itself + */ + public OTFDiffs putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OTFDiffs otFDiffs = (OTFDiffs) o; + return Objects.equals(this.diffs, otFDiffs.diffs)&& + Objects.equals(this.additionalProperties, otFDiffs.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(diffs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OTFDiffs {\n"); + sb.append(" diffs: ").append(toIndentedString(diffs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("diffs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OTFDiffs + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OTFDiffs.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OTFDiffs is not found in the empty JSON string", OTFDiffs.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("diffs") != null && !jsonObj.get("diffs").isJsonNull()) { + JsonArray jsonArraydiffs = jsonObj.getAsJsonArray("diffs"); + if (jsonArraydiffs != null) { + // ensure the json data is an array + if (!jsonObj.get("diffs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `diffs` to be an array in the JSON string but got `%s`", jsonObj.get("diffs").toString())); + } + + // validate the optional field `diffs` (array) + for (int i = 0; i < jsonArraydiffs.size(); i++) { + DiffProperties.validateJsonElement(jsonArraydiffs.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OTFDiffs.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OTFDiffs' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OTFDiffs.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OTFDiffs value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OTFDiffs read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OTFDiffs instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OTFDiffs given an JSON string + * + * @param jsonString JSON string + * @return An instance of OTFDiffs + * @throws IOException if the JSON string is invalid with respect to OTFDiffs + */ + public static OTFDiffs fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OTFDiffs.class); + } + + /** + * Convert an instance of OTFDiffs to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java new file mode 100644 index 00000000000..c4767185d86 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java @@ -0,0 +1,324 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectCopyCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectCopyCreation { + public static final String SERIALIZED_NAME_SRC_PATH = "src_path"; + @SerializedName(SERIALIZED_NAME_SRC_PATH) + private String srcPath; + + public static final String SERIALIZED_NAME_SRC_REF = "src_ref"; + @SerializedName(SERIALIZED_NAME_SRC_REF) + private String srcRef; + + public ObjectCopyCreation() { + } + + public ObjectCopyCreation srcPath(String srcPath) { + + this.srcPath = srcPath; + return this; + } + + /** + * path of the copied object relative to the ref + * @return srcPath + **/ + @javax.annotation.Nonnull + public String getSrcPath() { + return srcPath; + } + + + public void setSrcPath(String srcPath) { + this.srcPath = srcPath; + } + + + public ObjectCopyCreation srcRef(String srcRef) { + + this.srcRef = srcRef; + return this; + } + + /** + * a reference, if empty uses the provided branch as ref + * @return srcRef + **/ + @javax.annotation.Nullable + public String getSrcRef() { + return srcRef; + } + + + public void setSrcRef(String srcRef) { + this.srcRef = srcRef; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectCopyCreation instance itself + */ + public ObjectCopyCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectCopyCreation objectCopyCreation = (ObjectCopyCreation) o; + return Objects.equals(this.srcPath, objectCopyCreation.srcPath) && + Objects.equals(this.srcRef, objectCopyCreation.srcRef)&& + Objects.equals(this.additionalProperties, objectCopyCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(srcPath, srcRef, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectCopyCreation {\n"); + sb.append(" srcPath: ").append(toIndentedString(srcPath)).append("\n"); + sb.append(" srcRef: ").append(toIndentedString(srcRef)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("src_path"); + openapiFields.add("src_ref"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("src_path"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectCopyCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectCopyCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectCopyCreation is not found in the empty JSON string", ObjectCopyCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectCopyCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("src_path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `src_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("src_path").toString())); + } + if ((jsonObj.get("src_ref") != null && !jsonObj.get("src_ref").isJsonNull()) && !jsonObj.get("src_ref").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `src_ref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("src_ref").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectCopyCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectCopyCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectCopyCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectCopyCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectCopyCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectCopyCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectCopyCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectCopyCreation + * @throws IOException if the JSON string is invalid with respect to ObjectCopyCreation + */ + public static ObjectCopyCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectCopyCreation.class); + } + + /** + * Convert an instance of ObjectCopyCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java new file mode 100644 index 00000000000..aa580829a0a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java @@ -0,0 +1,353 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectError + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectError { + public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public ObjectError() { + } + + public ObjectError statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * HTTP status code associated for operation on path + * @return statusCode + **/ + @javax.annotation.Nonnull + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + + public ObjectError message(String message) { + + this.message = message; + return this; + } + + /** + * short message explaining status_code + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ObjectError path(String path) { + + this.path = path; + return this; + } + + /** + * affected path + * @return path + **/ + @javax.annotation.Nullable + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectError instance itself + */ + public ObjectError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectError objectError = (ObjectError) o; + return Objects.equals(this.statusCode, objectError.statusCode) && + Objects.equals(this.message, objectError.message) && + Objects.equals(this.path, objectError.path)&& + Objects.equals(this.additionalProperties, objectError.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(statusCode, message, path, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectError {\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status_code"); + openapiFields.add("message"); + openapiFields.add("path"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status_code"); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectError + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectError is not found in the empty JSON string", ObjectError.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectError.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectError read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectError instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectError + * @throws IOException if the JSON string is invalid with respect to ObjectError + */ + public static ObjectError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectError.class); + } + + /** + * Convert an instance of ObjectError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java new file mode 100644 index 00000000000..06ed0851767 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java @@ -0,0 +1,311 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.ObjectError; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectErrorList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectErrorList { + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + + public ObjectErrorList() { + } + + public ObjectErrorList errors(List errors) { + + this.errors = errors; + return this; + } + + public ObjectErrorList addErrorsItem(ObjectError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectErrorList instance itself + */ + public ObjectErrorList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectErrorList objectErrorList = (ObjectErrorList) o; + return Objects.equals(this.errors, objectErrorList.errors)&& + Objects.equals(this.additionalProperties, objectErrorList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectErrorList {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("errors"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectErrorList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectErrorList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectErrorList is not found in the empty JSON string", ObjectErrorList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectErrorList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + ObjectError.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectErrorList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectErrorList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectErrorList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectErrorList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectErrorList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectErrorList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectErrorList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectErrorList + * @throws IOException if the JSON string is invalid with respect to ObjectErrorList + */ + public static ObjectErrorList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectErrorList.class); + } + + /** + * Convert an instance of ObjectErrorList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java new file mode 100644 index 00000000000..619d380073b --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java @@ -0,0 +1,451 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectStageCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectStageCreation { + public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; + @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) + private String physicalAddress; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + @SerializedName(SERIALIZED_NAME_CHECKSUM) + private String checksum; + + public static final String SERIALIZED_NAME_SIZE_BYTES = "size_bytes"; + @SerializedName(SERIALIZED_NAME_SIZE_BYTES) + private Long sizeBytes; + + public static final String SERIALIZED_NAME_MTIME = "mtime"; + @SerializedName(SERIALIZED_NAME_MTIME) + private Long mtime; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_CONTENT_TYPE = "content_type"; + @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + private String contentType; + + public ObjectStageCreation() { + } + + public ObjectStageCreation physicalAddress(String physicalAddress) { + + this.physicalAddress = physicalAddress; + return this; + } + + /** + * Get physicalAddress + * @return physicalAddress + **/ + @javax.annotation.Nonnull + public String getPhysicalAddress() { + return physicalAddress; + } + + + public void setPhysicalAddress(String physicalAddress) { + this.physicalAddress = physicalAddress; + } + + + public ObjectStageCreation checksum(String checksum) { + + this.checksum = checksum; + return this; + } + + /** + * Get checksum + * @return checksum + **/ + @javax.annotation.Nonnull + public String getChecksum() { + return checksum; + } + + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + + public ObjectStageCreation sizeBytes(Long sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Get sizeBytes + * @return sizeBytes + **/ + @javax.annotation.Nonnull + public Long getSizeBytes() { + return sizeBytes; + } + + + public void setSizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + + public ObjectStageCreation mtime(Long mtime) { + + this.mtime = mtime; + return this; + } + + /** + * Unix Epoch in seconds + * @return mtime + **/ + @javax.annotation.Nullable + public Long getMtime() { + return mtime; + } + + + public void setMtime(Long mtime) { + this.mtime = mtime; + } + + + public ObjectStageCreation metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public ObjectStageCreation putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public ObjectStageCreation contentType(String contentType) { + + this.contentType = contentType; + return this; + } + + /** + * Object media type + * @return contentType + **/ + @javax.annotation.Nullable + public String getContentType() { + return contentType; + } + + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectStageCreation instance itself + */ + public ObjectStageCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectStageCreation objectStageCreation = (ObjectStageCreation) o; + return Objects.equals(this.physicalAddress, objectStageCreation.physicalAddress) && + Objects.equals(this.checksum, objectStageCreation.checksum) && + Objects.equals(this.sizeBytes, objectStageCreation.sizeBytes) && + Objects.equals(this.mtime, objectStageCreation.mtime) && + Objects.equals(this.metadata, objectStageCreation.metadata) && + Objects.equals(this.contentType, objectStageCreation.contentType)&& + Objects.equals(this.additionalProperties, objectStageCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(physicalAddress, checksum, sizeBytes, mtime, metadata, contentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectStageCreation {\n"); + sb.append(" physicalAddress: ").append(toIndentedString(physicalAddress)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" mtime: ").append(toIndentedString(mtime)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("physical_address"); + openapiFields.add("checksum"); + openapiFields.add("size_bytes"); + openapiFields.add("mtime"); + openapiFields.add("metadata"); + openapiFields.add("content_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("physical_address"); + openapiRequiredFields.add("checksum"); + openapiRequiredFields.add("size_bytes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStageCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectStageCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectStageCreation is not found in the empty JSON string", ObjectStageCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectStageCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("physical_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `physical_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("physical_address").toString())); + } + if (!jsonObj.get("checksum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checksum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checksum").toString())); + } + if ((jsonObj.get("content_type") != null && !jsonObj.get("content_type").isJsonNull()) && !jsonObj.get("content_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `content_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectStageCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectStageCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectStageCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectStageCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectStageCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectStageCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectStageCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStageCreation + * @throws IOException if the JSON string is invalid with respect to ObjectStageCreation + */ + public static ObjectStageCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectStageCreation.class); + } + + /** + * Convert an instance of ObjectStageCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java new file mode 100644 index 00000000000..76a5d786469 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java @@ -0,0 +1,590 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectStats { + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + /** + * Gets or Sets pathType + */ + @JsonAdapter(PathTypeEnum.Adapter.class) + public enum PathTypeEnum { + COMMON_PREFIX("common_prefix"), + + OBJECT("object"); + + private String value; + + PathTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PathTypeEnum fromValue(String value) { + for (PathTypeEnum b : PathTypeEnum.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 PathTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PathTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PathTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PATH_TYPE = "path_type"; + @SerializedName(SERIALIZED_NAME_PATH_TYPE) + private PathTypeEnum pathType; + + public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; + @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) + private String physicalAddress; + + public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS_EXPIRY = "physical_address_expiry"; + @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS_EXPIRY) + private Long physicalAddressExpiry; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + @SerializedName(SERIALIZED_NAME_CHECKSUM) + private String checksum; + + public static final String SERIALIZED_NAME_SIZE_BYTES = "size_bytes"; + @SerializedName(SERIALIZED_NAME_SIZE_BYTES) + private Long sizeBytes; + + public static final String SERIALIZED_NAME_MTIME = "mtime"; + @SerializedName(SERIALIZED_NAME_MTIME) + private Long mtime; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_CONTENT_TYPE = "content_type"; + @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + private String contentType; + + public ObjectStats() { + } + + public ObjectStats path(String path) { + + this.path = path; + return this; + } + + /** + * Get path + * @return path + **/ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + + public ObjectStats pathType(PathTypeEnum pathType) { + + this.pathType = pathType; + return this; + } + + /** + * Get pathType + * @return pathType + **/ + @javax.annotation.Nonnull + public PathTypeEnum getPathType() { + return pathType; + } + + + public void setPathType(PathTypeEnum pathType) { + this.pathType = pathType; + } + + + public ObjectStats physicalAddress(String physicalAddress) { + + this.physicalAddress = physicalAddress; + return this; + } + + /** + * The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET + * @return physicalAddress + **/ + @javax.annotation.Nonnull + public String getPhysicalAddress() { + return physicalAddress; + } + + + public void setPhysicalAddress(String physicalAddress) { + this.physicalAddress = physicalAddress; + } + + + public ObjectStats physicalAddressExpiry(Long physicalAddressExpiry) { + + this.physicalAddressExpiry = physicalAddressExpiry; + return this; + } + + /** + * If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. + * @return physicalAddressExpiry + **/ + @javax.annotation.Nullable + public Long getPhysicalAddressExpiry() { + return physicalAddressExpiry; + } + + + public void setPhysicalAddressExpiry(Long physicalAddressExpiry) { + this.physicalAddressExpiry = physicalAddressExpiry; + } + + + public ObjectStats checksum(String checksum) { + + this.checksum = checksum; + return this; + } + + /** + * Get checksum + * @return checksum + **/ + @javax.annotation.Nonnull + public String getChecksum() { + return checksum; + } + + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + + public ObjectStats sizeBytes(Long sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Get sizeBytes + * @return sizeBytes + **/ + @javax.annotation.Nullable + public Long getSizeBytes() { + return sizeBytes; + } + + + public void setSizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + + public ObjectStats mtime(Long mtime) { + + this.mtime = mtime; + return this; + } + + /** + * Unix Epoch in seconds + * @return mtime + **/ + @javax.annotation.Nonnull + public Long getMtime() { + return mtime; + } + + + public void setMtime(Long mtime) { + this.mtime = mtime; + } + + + public ObjectStats metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public ObjectStats putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public ObjectStats contentType(String contentType) { + + this.contentType = contentType; + return this; + } + + /** + * Object media type + * @return contentType + **/ + @javax.annotation.Nullable + public String getContentType() { + return contentType; + } + + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectStats instance itself + */ + public ObjectStats putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectStats objectStats = (ObjectStats) o; + return Objects.equals(this.path, objectStats.path) && + Objects.equals(this.pathType, objectStats.pathType) && + Objects.equals(this.physicalAddress, objectStats.physicalAddress) && + Objects.equals(this.physicalAddressExpiry, objectStats.physicalAddressExpiry) && + Objects.equals(this.checksum, objectStats.checksum) && + Objects.equals(this.sizeBytes, objectStats.sizeBytes) && + Objects.equals(this.mtime, objectStats.mtime) && + Objects.equals(this.metadata, objectStats.metadata) && + Objects.equals(this.contentType, objectStats.contentType)&& + Objects.equals(this.additionalProperties, objectStats.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(path, pathType, physicalAddress, physicalAddressExpiry, checksum, sizeBytes, mtime, metadata, contentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectStats {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathType: ").append(toIndentedString(pathType)).append("\n"); + sb.append(" physicalAddress: ").append(toIndentedString(physicalAddress)).append("\n"); + sb.append(" physicalAddressExpiry: ").append(toIndentedString(physicalAddressExpiry)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" mtime: ").append(toIndentedString(mtime)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("path"); + openapiFields.add("path_type"); + openapiFields.add("physical_address"); + openapiFields.add("physical_address_expiry"); + openapiFields.add("checksum"); + openapiFields.add("size_bytes"); + openapiFields.add("mtime"); + openapiFields.add("metadata"); + openapiFields.add("content_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("path"); + openapiRequiredFields.add("path_type"); + openapiRequiredFields.add("physical_address"); + openapiRequiredFields.add("checksum"); + openapiRequiredFields.add("mtime"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectStats is not found in the empty JSON string", ObjectStats.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if (!jsonObj.get("path_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path_type").toString())); + } + if (!jsonObj.get("physical_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `physical_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("physical_address").toString())); + } + if (!jsonObj.get("checksum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checksum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checksum").toString())); + } + if ((jsonObj.get("content_type") != null && !jsonObj.get("content_type").isJsonNull()) && !jsonObj.get("content_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `content_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectStats instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStats + * @throws IOException if the JSON string is invalid with respect to ObjectStats + */ + public static ObjectStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectStats.class); + } + + /** + * Convert an instance of ObjectStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java new file mode 100644 index 00000000000..a95bdfc5eb5 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ObjectStatsList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectStatsList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public ObjectStatsList() { + } + + public ObjectStatsList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public ObjectStatsList results(List results) { + + this.results = results; + return this; + } + + public ObjectStatsList addResultsItem(ObjectStats resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectStatsList instance itself + */ + public ObjectStatsList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectStatsList objectStatsList = (ObjectStatsList) o; + return Objects.equals(this.pagination, objectStatsList.pagination) && + Objects.equals(this.results, objectStatsList.results)&& + Objects.equals(this.additionalProperties, objectStatsList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectStatsList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStatsList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ObjectStatsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectStatsList is not found in the empty JSON string", ObjectStatsList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ObjectStatsList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + ObjectStats.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectStatsList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectStatsList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectStatsList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectStatsList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ObjectStatsList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ObjectStatsList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ObjectStatsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStatsList + * @throws IOException if the JSON string is invalid with respect to ObjectStatsList + */ + public static ObjectStatsList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectStatsList.class); + } + + /** + * Convert an instance of ObjectStatsList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffEntry.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffEntry.java new file mode 100644 index 00000000000..35e214c3e7d --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffEntry.java @@ -0,0 +1,464 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * OtfDiffEntry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OtfDiffEntry { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private Integer timestamp; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public static final String SERIALIZED_NAME_OPERATION_CONTENT = "operation_content"; + @SerializedName(SERIALIZED_NAME_OPERATION_CONTENT) + private Object operationContent; + + /** + * the operation category (CUD) + */ + @JsonAdapter(OperationTypeEnum.Adapter.class) + public enum OperationTypeEnum { + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"); + + private String value; + + OperationTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperationTypeEnum fromValue(String value) { + for (OperationTypeEnum b : OperationTypeEnum.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 OperationTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperationTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_OPERATION_TYPE = "operation_type"; + @SerializedName(SERIALIZED_NAME_OPERATION_TYPE) + private OperationTypeEnum operationType; + + public OtfDiffEntry() { + } + + public OtfDiffEntry id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public OtfDiffEntry timestamp(Integer timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public Integer getTimestamp() { + return timestamp; + } + + + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + + public OtfDiffEntry operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + **/ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + public OtfDiffEntry operationContent(Object operationContent) { + + this.operationContent = operationContent; + return this; + } + + /** + * free form content describing the returned operation diff + * @return operationContent + **/ + @javax.annotation.Nonnull + public Object getOperationContent() { + return operationContent; + } + + + public void setOperationContent(Object operationContent) { + this.operationContent = operationContent; + } + + + public OtfDiffEntry operationType(OperationTypeEnum operationType) { + + this.operationType = operationType; + return this; + } + + /** + * the operation category (CUD) + * @return operationType + **/ + @javax.annotation.Nonnull + public OperationTypeEnum getOperationType() { + return operationType; + } + + + public void setOperationType(OperationTypeEnum operationType) { + this.operationType = operationType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OtfDiffEntry instance itself + */ + public OtfDiffEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OtfDiffEntry otfDiffEntry = (OtfDiffEntry) o; + return Objects.equals(this.id, otfDiffEntry.id) && + Objects.equals(this.timestamp, otfDiffEntry.timestamp) && + Objects.equals(this.operation, otfDiffEntry.operation) && + Objects.equals(this.operationContent, otfDiffEntry.operationContent) && + Objects.equals(this.operationType, otfDiffEntry.operationType)&& + Objects.equals(this.additionalProperties, otfDiffEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, timestamp, operation, operationContent, operationType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OtfDiffEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" operationContent: ").append(toIndentedString(operationContent)).append("\n"); + sb.append(" operationType: ").append(toIndentedString(operationType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("timestamp"); + openapiFields.add("operation"); + openapiFields.add("operation_content"); + openapiFields.add("operation_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("operation"); + openapiRequiredFields.add("operation_content"); + openapiRequiredFields.add("operation_type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OtfDiffEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OtfDiffEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OtfDiffEntry is not found in the empty JSON string", OtfDiffEntry.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OtfDiffEntry.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + if (!jsonObj.get("operation_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OtfDiffEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OtfDiffEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OtfDiffEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OtfDiffEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OtfDiffEntry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OtfDiffEntry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OtfDiffEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of OtfDiffEntry + * @throws IOException if the JSON string is invalid with respect to OtfDiffEntry + */ + public static OtfDiffEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OtfDiffEntry.class); + } + + /** + * Convert an instance of OtfDiffEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffList.java new file mode 100644 index 00000000000..c20d548b498 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/OtfDiffList.java @@ -0,0 +1,391 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.OtfDiffEntry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * OtfDiffList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OtfDiffList { + /** + * Gets or Sets diffType + */ + @JsonAdapter(DiffTypeEnum.Adapter.class) + public enum DiffTypeEnum { + CREATED("created"), + + DROPPED("dropped"), + + CHANGED("changed"); + + private String value; + + DiffTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DiffTypeEnum fromValue(String value) { + for (DiffTypeEnum b : DiffTypeEnum.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 DiffTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DiffTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DiffTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_DIFF_TYPE = "diff_type"; + @SerializedName(SERIALIZED_NAME_DIFF_TYPE) + private DiffTypeEnum diffType; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public OtfDiffList() { + } + + public OtfDiffList diffType(DiffTypeEnum diffType) { + + this.diffType = diffType; + return this; + } + + /** + * Get diffType + * @return diffType + **/ + @javax.annotation.Nullable + public DiffTypeEnum getDiffType() { + return diffType; + } + + + public void setDiffType(DiffTypeEnum diffType) { + this.diffType = diffType; + } + + + public OtfDiffList results(List results) { + + this.results = results; + return this; + } + + public OtfDiffList addResultsItem(OtfDiffEntry resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OtfDiffList instance itself + */ + public OtfDiffList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OtfDiffList otfDiffList = (OtfDiffList) o; + return Objects.equals(this.diffType, otfDiffList.diffType) && + Objects.equals(this.results, otfDiffList.results)&& + Objects.equals(this.additionalProperties, otfDiffList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(diffType, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OtfDiffList {\n"); + sb.append(" diffType: ").append(toIndentedString(diffType)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("diff_type"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OtfDiffList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OtfDiffList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OtfDiffList is not found in the empty JSON string", OtfDiffList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OtfDiffList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("diff_type") != null && !jsonObj.get("diff_type").isJsonNull()) && !jsonObj.get("diff_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `diff_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diff_type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + OtfDiffEntry.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OtfDiffList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OtfDiffList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OtfDiffList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OtfDiffList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OtfDiffList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OtfDiffList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OtfDiffList given an JSON string + * + * @param jsonString JSON string + * @return An instance of OtfDiffList + * @throws IOException if the JSON string is invalid with respect to OtfDiffList + */ + public static OtfDiffList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OtfDiffList.class); + } + + /** + * Convert an instance of OtfDiffList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java new file mode 100644 index 00000000000..6e0e2cb5ce5 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java @@ -0,0 +1,382 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Pagination + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pagination { + public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; + @SerializedName(SERIALIZED_NAME_HAS_MORE) + private Boolean hasMore; + + public static final String SERIALIZED_NAME_NEXT_OFFSET = "next_offset"; + @SerializedName(SERIALIZED_NAME_NEXT_OFFSET) + private String nextOffset; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private Integer results; + + public static final String SERIALIZED_NAME_MAX_PER_PAGE = "max_per_page"; + @SerializedName(SERIALIZED_NAME_MAX_PER_PAGE) + private Integer maxPerPage; + + public Pagination() { + } + + public Pagination hasMore(Boolean hasMore) { + + this.hasMore = hasMore; + return this; + } + + /** + * Next page is available + * @return hasMore + **/ + @javax.annotation.Nonnull + public Boolean getHasMore() { + return hasMore; + } + + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + + public Pagination nextOffset(String nextOffset) { + + this.nextOffset = nextOffset; + return this; + } + + /** + * Token used to retrieve the next page + * @return nextOffset + **/ + @javax.annotation.Nonnull + public String getNextOffset() { + return nextOffset; + } + + + public void setNextOffset(String nextOffset) { + this.nextOffset = nextOffset; + } + + + public Pagination results(Integer results) { + + this.results = results; + return this; + } + + /** + * Number of values found in the results + * minimum: 0 + * @return results + **/ + @javax.annotation.Nonnull + public Integer getResults() { + return results; + } + + + public void setResults(Integer results) { + this.results = results; + } + + + public Pagination maxPerPage(Integer maxPerPage) { + + this.maxPerPage = maxPerPage; + return this; + } + + /** + * Maximal number of entries per page + * minimum: 0 + * @return maxPerPage + **/ + @javax.annotation.Nonnull + public Integer getMaxPerPage() { + return maxPerPage; + } + + + public void setMaxPerPage(Integer maxPerPage) { + this.maxPerPage = maxPerPage; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Pagination instance itself + */ + public Pagination putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pagination pagination = (Pagination) o; + return Objects.equals(this.hasMore, pagination.hasMore) && + Objects.equals(this.nextOffset, pagination.nextOffset) && + Objects.equals(this.results, pagination.results) && + Objects.equals(this.maxPerPage, pagination.maxPerPage)&& + Objects.equals(this.additionalProperties, pagination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasMore, nextOffset, results, maxPerPage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pagination {\n"); + sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); + sb.append(" nextOffset: ").append(toIndentedString(nextOffset)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" maxPerPage: ").append(toIndentedString(maxPerPage)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("has_more"); + openapiFields.add("next_offset"); + openapiFields.add("results"); + openapiFields.add("max_per_page"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("has_more"); + openapiRequiredFields.add("next_offset"); + openapiRequiredFields.add("results"); + openapiRequiredFields.add("max_per_page"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Pagination + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Pagination.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Pagination is not found in the empty JSON string", Pagination.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pagination.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("next_offset").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next_offset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_offset").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pagination.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pagination' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pagination.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pagination value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Pagination read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Pagination instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pagination given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pagination + * @throws IOException if the JSON string is invalid with respect to Pagination + */ + public static Pagination fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pagination.class); + } + + /** + * Convert an instance of Pagination to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java new file mode 100644 index 00000000000..a67f094ed7a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java @@ -0,0 +1,306 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * PathList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PathList { + public static final String SERIALIZED_NAME_PATHS = "paths"; + @SerializedName(SERIALIZED_NAME_PATHS) + private List paths = new ArrayList<>(); + + public PathList() { + } + + public PathList paths(List paths) { + + this.paths = paths; + return this; + } + + public PathList addPathsItem(String pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * Get paths + * @return paths + **/ + @javax.annotation.Nonnull + public List getPaths() { + return paths; + } + + + public void setPaths(List paths) { + this.paths = paths; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PathList instance itself + */ + public PathList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PathList pathList = (PathList) o; + return Objects.equals(this.paths, pathList.paths)&& + Objects.equals(this.additionalProperties, pathList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(paths, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PathList {\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("paths"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("paths"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PathList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PathList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PathList is not found in the empty JSON string", PathList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PathList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("paths") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("paths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `paths` to be an array in the JSON string but got `%s`", jsonObj.get("paths").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PathList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PathList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PathList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PathList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PathList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PathList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PathList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PathList + * @throws IOException if the JSON string is invalid with respect to PathList + */ + public static PathList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PathList.class); + } + + /** + * Convert an instance of PathList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java new file mode 100644 index 00000000000..fd20c42c2a1 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java @@ -0,0 +1,371 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Statement; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Policy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Policy { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public static final String SERIALIZED_NAME_STATEMENT = "statement"; + @SerializedName(SERIALIZED_NAME_STATEMENT) + private List statement = new ArrayList<>(); + + public Policy() { + } + + public Policy id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Policy creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nullable + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public Policy statement(List statement) { + + this.statement = statement; + return this; + } + + public Policy addStatementItem(Statement statementItem) { + if (this.statement == null) { + this.statement = new ArrayList<>(); + } + this.statement.add(statementItem); + return this; + } + + /** + * Get statement + * @return statement + **/ + @javax.annotation.Nonnull + public List getStatement() { + return statement; + } + + + public void setStatement(List statement) { + this.statement = statement; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Policy instance itself + */ + public Policy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Policy policy = (Policy) o; + return Objects.equals(this.id, policy.id) && + Objects.equals(this.creationDate, policy.creationDate) && + Objects.equals(this.statement, policy.statement)&& + Objects.equals(this.additionalProperties, policy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, statement, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Policy {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" statement: ").append(toIndentedString(statement)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("creation_date"); + openapiFields.add("statement"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("statement"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Policy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Policy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Policy is not found in the empty JSON string", Policy.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Policy.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("statement").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `statement` to be an array in the JSON string but got `%s`", jsonObj.get("statement").toString())); + } + + JsonArray jsonArraystatement = jsonObj.getAsJsonArray("statement"); + // validate the required field `statement` (array) + for (int i = 0; i < jsonArraystatement.size(); i++) { + Statement.validateJsonElement(jsonArraystatement.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Policy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Policy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Policy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Policy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Policy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Policy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Policy given an JSON string + * + * @param jsonString JSON string + * @return An instance of Policy + * @throws IOException if the JSON string is invalid with respect to Policy + */ + public static Policy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Policy.class); + } + + /** + * Convert an instance of Policy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java new file mode 100644 index 00000000000..3219dd18d84 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Policy; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * PolicyList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PolicyList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public PolicyList() { + } + + public PolicyList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public PolicyList results(List results) { + + this.results = results; + return this; + } + + public PolicyList addResultsItem(Policy resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PolicyList instance itself + */ + public PolicyList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PolicyList policyList = (PolicyList) o; + return Objects.equals(this.pagination, policyList.pagination) && + Objects.equals(this.results, policyList.results)&& + Objects.equals(this.additionalProperties, policyList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PolicyList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PolicyList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PolicyList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PolicyList is not found in the empty JSON string", PolicyList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PolicyList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Policy.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PolicyList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PolicyList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PolicyList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PolicyList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PolicyList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PolicyList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PolicyList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PolicyList + * @throws IOException if the JSON string is invalid with respect to PolicyList + */ + public static PolicyList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PolicyList.class); + } + + /** + * Convert an instance of PolicyList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java new file mode 100644 index 00000000000..d3eb235f9ca --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java @@ -0,0 +1,285 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * PrepareGCUncommittedRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PrepareGCUncommittedRequest { + public static final String SERIALIZED_NAME_CONTINUATION_TOKEN = "continuation_token"; + @SerializedName(SERIALIZED_NAME_CONTINUATION_TOKEN) + private String continuationToken; + + public PrepareGCUncommittedRequest() { + } + + public PrepareGCUncommittedRequest continuationToken(String continuationToken) { + + this.continuationToken = continuationToken; + return this; + } + + /** + * Get continuationToken + * @return continuationToken + **/ + @javax.annotation.Nullable + public String getContinuationToken() { + return continuationToken; + } + + + public void setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrepareGCUncommittedRequest instance itself + */ + public PrepareGCUncommittedRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrepareGCUncommittedRequest prepareGCUncommittedRequest = (PrepareGCUncommittedRequest) o; + return Objects.equals(this.continuationToken, prepareGCUncommittedRequest.continuationToken)&& + Objects.equals(this.additionalProperties, prepareGCUncommittedRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(continuationToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrepareGCUncommittedRequest {\n"); + sb.append(" continuationToken: ").append(toIndentedString(continuationToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("continuation_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrepareGCUncommittedRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrepareGCUncommittedRequest is not found in the empty JSON string", PrepareGCUncommittedRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("continuation_token") != null && !jsonObj.get("continuation_token").isJsonNull()) && !jsonObj.get("continuation_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `continuation_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("continuation_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrepareGCUncommittedRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrepareGCUncommittedRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrepareGCUncommittedRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PrepareGCUncommittedRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrepareGCUncommittedRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrepareGCUncommittedRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrepareGCUncommittedRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrepareGCUncommittedRequest + * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedRequest + */ + public static PrepareGCUncommittedRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrepareGCUncommittedRequest.class); + } + + /** + * Convert an instance of PrepareGCUncommittedRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java new file mode 100644 index 00000000000..31267ba8d45 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java @@ -0,0 +1,356 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * PrepareGCUncommittedResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PrepareGCUncommittedResponse { + public static final String SERIALIZED_NAME_RUN_ID = "run_id"; + @SerializedName(SERIALIZED_NAME_RUN_ID) + private String runId; + + public static final String SERIALIZED_NAME_GC_UNCOMMITTED_LOCATION = "gc_uncommitted_location"; + @SerializedName(SERIALIZED_NAME_GC_UNCOMMITTED_LOCATION) + private String gcUncommittedLocation; + + public static final String SERIALIZED_NAME_CONTINUATION_TOKEN = "continuation_token"; + @SerializedName(SERIALIZED_NAME_CONTINUATION_TOKEN) + private String continuationToken; + + public PrepareGCUncommittedResponse() { + } + + public PrepareGCUncommittedResponse runId(String runId) { + + this.runId = runId; + return this; + } + + /** + * Get runId + * @return runId + **/ + @javax.annotation.Nonnull + public String getRunId() { + return runId; + } + + + public void setRunId(String runId) { + this.runId = runId; + } + + + public PrepareGCUncommittedResponse gcUncommittedLocation(String gcUncommittedLocation) { + + this.gcUncommittedLocation = gcUncommittedLocation; + return this; + } + + /** + * location of uncommitted information data + * @return gcUncommittedLocation + **/ + @javax.annotation.Nonnull + public String getGcUncommittedLocation() { + return gcUncommittedLocation; + } + + + public void setGcUncommittedLocation(String gcUncommittedLocation) { + this.gcUncommittedLocation = gcUncommittedLocation; + } + + + public PrepareGCUncommittedResponse continuationToken(String continuationToken) { + + this.continuationToken = continuationToken; + return this; + } + + /** + * Get continuationToken + * @return continuationToken + **/ + @javax.annotation.Nullable + public String getContinuationToken() { + return continuationToken; + } + + + public void setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrepareGCUncommittedResponse instance itself + */ + public PrepareGCUncommittedResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrepareGCUncommittedResponse prepareGCUncommittedResponse = (PrepareGCUncommittedResponse) o; + return Objects.equals(this.runId, prepareGCUncommittedResponse.runId) && + Objects.equals(this.gcUncommittedLocation, prepareGCUncommittedResponse.gcUncommittedLocation) && + Objects.equals(this.continuationToken, prepareGCUncommittedResponse.continuationToken)&& + Objects.equals(this.additionalProperties, prepareGCUncommittedResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(runId, gcUncommittedLocation, continuationToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrepareGCUncommittedResponse {\n"); + sb.append(" runId: ").append(toIndentedString(runId)).append("\n"); + sb.append(" gcUncommittedLocation: ").append(toIndentedString(gcUncommittedLocation)).append("\n"); + sb.append(" continuationToken: ").append(toIndentedString(continuationToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("run_id"); + openapiFields.add("gc_uncommitted_location"); + openapiFields.add("continuation_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("run_id"); + openapiRequiredFields.add("gc_uncommitted_location"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrepareGCUncommittedResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrepareGCUncommittedResponse is not found in the empty JSON string", PrepareGCUncommittedResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrepareGCUncommittedResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("run_id").toString())); + } + if (!jsonObj.get("gc_uncommitted_location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gc_uncommitted_location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gc_uncommitted_location").toString())); + } + if ((jsonObj.get("continuation_token") != null && !jsonObj.get("continuation_token").isJsonNull()) && !jsonObj.get("continuation_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `continuation_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("continuation_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrepareGCUncommittedResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrepareGCUncommittedResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrepareGCUncommittedResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PrepareGCUncommittedResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrepareGCUncommittedResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrepareGCUncommittedResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrepareGCUncommittedResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrepareGCUncommittedResponse + * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedResponse + */ + public static PrepareGCUncommittedResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrepareGCUncommittedResponse.class); + } + + /** + * Convert an instance of PrepareGCUncommittedResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java new file mode 100644 index 00000000000..5e19c1b8521 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java @@ -0,0 +1,415 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RangeMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RangeMetadata { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_MIN_KEY = "min_key"; + @SerializedName(SERIALIZED_NAME_MIN_KEY) + private String minKey; + + public static final String SERIALIZED_NAME_MAX_KEY = "max_key"; + @SerializedName(SERIALIZED_NAME_MAX_KEY) + private String maxKey; + + public static final String SERIALIZED_NAME_COUNT = "count"; + @SerializedName(SERIALIZED_NAME_COUNT) + private Integer count; + + public static final String SERIALIZED_NAME_ESTIMATED_SIZE = "estimated_size"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_SIZE) + private Integer estimatedSize; + + public RangeMetadata() { + } + + public RangeMetadata id(String id) { + + this.id = id; + return this; + } + + /** + * ID of the range. + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public RangeMetadata minKey(String minKey) { + + this.minKey = minKey; + return this; + } + + /** + * First key in the range. + * @return minKey + **/ + @javax.annotation.Nonnull + public String getMinKey() { + return minKey; + } + + + public void setMinKey(String minKey) { + this.minKey = minKey; + } + + + public RangeMetadata maxKey(String maxKey) { + + this.maxKey = maxKey; + return this; + } + + /** + * Last key in the range. + * @return maxKey + **/ + @javax.annotation.Nonnull + public String getMaxKey() { + return maxKey; + } + + + public void setMaxKey(String maxKey) { + this.maxKey = maxKey; + } + + + public RangeMetadata count(Integer count) { + + this.count = count; + return this; + } + + /** + * Number of records in the range. + * @return count + **/ + @javax.annotation.Nonnull + public Integer getCount() { + return count; + } + + + public void setCount(Integer count) { + this.count = count; + } + + + public RangeMetadata estimatedSize(Integer estimatedSize) { + + this.estimatedSize = estimatedSize; + return this; + } + + /** + * Estimated size of the range in bytes + * @return estimatedSize + **/ + @javax.annotation.Nonnull + public Integer getEstimatedSize() { + return estimatedSize; + } + + + public void setEstimatedSize(Integer estimatedSize) { + this.estimatedSize = estimatedSize; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RangeMetadata instance itself + */ + public RangeMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RangeMetadata rangeMetadata = (RangeMetadata) o; + return Objects.equals(this.id, rangeMetadata.id) && + Objects.equals(this.minKey, rangeMetadata.minKey) && + Objects.equals(this.maxKey, rangeMetadata.maxKey) && + Objects.equals(this.count, rangeMetadata.count) && + Objects.equals(this.estimatedSize, rangeMetadata.estimatedSize)&& + Objects.equals(this.additionalProperties, rangeMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, minKey, maxKey, count, estimatedSize, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RangeMetadata {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" minKey: ").append(toIndentedString(minKey)).append("\n"); + sb.append(" maxKey: ").append(toIndentedString(maxKey)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" estimatedSize: ").append(toIndentedString(estimatedSize)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("min_key"); + openapiFields.add("max_key"); + openapiFields.add("count"); + openapiFields.add("estimated_size"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("min_key"); + openapiRequiredFields.add("max_key"); + openapiRequiredFields.add("count"); + openapiRequiredFields.add("estimated_size"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RangeMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RangeMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RangeMetadata is not found in the empty JSON string", RangeMetadata.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RangeMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("min_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `min_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("min_key").toString())); + } + if (!jsonObj.get("max_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `max_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("max_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RangeMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RangeMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RangeMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RangeMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RangeMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RangeMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RangeMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of RangeMetadata + * @throws IOException if the JSON string is invalid with respect to RangeMetadata + */ + public static RangeMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RangeMetadata.class); + } + + /** + * Convert an instance of RangeMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java new file mode 100644 index 00000000000..396ff5cd70e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java @@ -0,0 +1,325 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Ref + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Ref { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_COMMIT_ID = "commit_id"; + @SerializedName(SERIALIZED_NAME_COMMIT_ID) + private String commitId; + + public Ref() { + } + + public Ref id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Ref commitId(String commitId) { + + this.commitId = commitId; + return this; + } + + /** + * Get commitId + * @return commitId + **/ + @javax.annotation.Nonnull + public String getCommitId() { + return commitId; + } + + + public void setCommitId(String commitId) { + this.commitId = commitId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Ref instance itself + */ + public Ref putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ref ref = (Ref) o; + return Objects.equals(this.id, ref.id) && + Objects.equals(this.commitId, ref.commitId)&& + Objects.equals(this.additionalProperties, ref.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, commitId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Ref {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" commitId: ").append(toIndentedString(commitId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("commit_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("commit_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Ref + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Ref.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Ref is not found in the empty JSON string", Ref.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Ref.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("commit_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commit_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Ref.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Ref' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Ref.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Ref value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Ref read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Ref instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Ref given an JSON string + * + * @param jsonString JSON string + * @return An instance of Ref + * @throws IOException if the JSON string is invalid with respect to Ref + */ + public static Ref fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Ref.class); + } + + /** + * Convert an instance of Ref to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java new file mode 100644 index 00000000000..d13ea3c388a --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Ref; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RefList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public RefList() { + } + + public RefList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public RefList results(List results) { + + this.results = results; + return this; + } + + public RefList addResultsItem(Ref resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RefList instance itself + */ + public RefList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefList refList = (RefList) o; + return Objects.equals(this.pagination, refList.pagination) && + Objects.equals(this.results, refList.results)&& + Objects.equals(this.additionalProperties, refList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RefList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefList is not found in the empty JSON string", RefList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Ref.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RefList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RefList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefList given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefList + * @throws IOException if the JSON string is invalid with respect to RefList + */ + public static RefList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefList.class); + } + + /** + * Convert an instance of RefList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java new file mode 100644 index 00000000000..e33400885d8 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java @@ -0,0 +1,357 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RefsDump + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefsDump { + public static final String SERIALIZED_NAME_COMMITS_META_RANGE_ID = "commits_meta_range_id"; + @SerializedName(SERIALIZED_NAME_COMMITS_META_RANGE_ID) + private String commitsMetaRangeId; + + public static final String SERIALIZED_NAME_TAGS_META_RANGE_ID = "tags_meta_range_id"; + @SerializedName(SERIALIZED_NAME_TAGS_META_RANGE_ID) + private String tagsMetaRangeId; + + public static final String SERIALIZED_NAME_BRANCHES_META_RANGE_ID = "branches_meta_range_id"; + @SerializedName(SERIALIZED_NAME_BRANCHES_META_RANGE_ID) + private String branchesMetaRangeId; + + public RefsDump() { + } + + public RefsDump commitsMetaRangeId(String commitsMetaRangeId) { + + this.commitsMetaRangeId = commitsMetaRangeId; + return this; + } + + /** + * Get commitsMetaRangeId + * @return commitsMetaRangeId + **/ + @javax.annotation.Nonnull + public String getCommitsMetaRangeId() { + return commitsMetaRangeId; + } + + + public void setCommitsMetaRangeId(String commitsMetaRangeId) { + this.commitsMetaRangeId = commitsMetaRangeId; + } + + + public RefsDump tagsMetaRangeId(String tagsMetaRangeId) { + + this.tagsMetaRangeId = tagsMetaRangeId; + return this; + } + + /** + * Get tagsMetaRangeId + * @return tagsMetaRangeId + **/ + @javax.annotation.Nonnull + public String getTagsMetaRangeId() { + return tagsMetaRangeId; + } + + + public void setTagsMetaRangeId(String tagsMetaRangeId) { + this.tagsMetaRangeId = tagsMetaRangeId; + } + + + public RefsDump branchesMetaRangeId(String branchesMetaRangeId) { + + this.branchesMetaRangeId = branchesMetaRangeId; + return this; + } + + /** + * Get branchesMetaRangeId + * @return branchesMetaRangeId + **/ + @javax.annotation.Nonnull + public String getBranchesMetaRangeId() { + return branchesMetaRangeId; + } + + + public void setBranchesMetaRangeId(String branchesMetaRangeId) { + this.branchesMetaRangeId = branchesMetaRangeId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RefsDump instance itself + */ + public RefsDump putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefsDump refsDump = (RefsDump) o; + return Objects.equals(this.commitsMetaRangeId, refsDump.commitsMetaRangeId) && + Objects.equals(this.tagsMetaRangeId, refsDump.tagsMetaRangeId) && + Objects.equals(this.branchesMetaRangeId, refsDump.branchesMetaRangeId)&& + Objects.equals(this.additionalProperties, refsDump.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(commitsMetaRangeId, tagsMetaRangeId, branchesMetaRangeId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefsDump {\n"); + sb.append(" commitsMetaRangeId: ").append(toIndentedString(commitsMetaRangeId)).append("\n"); + sb.append(" tagsMetaRangeId: ").append(toIndentedString(tagsMetaRangeId)).append("\n"); + sb.append(" branchesMetaRangeId: ").append(toIndentedString(branchesMetaRangeId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commits_meta_range_id"); + openapiFields.add("tags_meta_range_id"); + openapiFields.add("branches_meta_range_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("commits_meta_range_id"); + openapiRequiredFields.add("tags_meta_range_id"); + openapiRequiredFields.add("branches_meta_range_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefsDump + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RefsDump.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefsDump is not found in the empty JSON string", RefsDump.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefsDump.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("commits_meta_range_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commits_meta_range_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commits_meta_range_id").toString())); + } + if (!jsonObj.get("tags_meta_range_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tags_meta_range_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tags_meta_range_id").toString())); + } + if (!jsonObj.get("branches_meta_range_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branches_meta_range_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branches_meta_range_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefsDump.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefsDump' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefsDump.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefsDump value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RefsDump read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RefsDump instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefsDump given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefsDump + * @throws IOException if the JSON string is invalid with respect to RefsDump + */ + public static RefsDump fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefsDump.class); + } + + /** + * Convert an instance of RefsDump to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java new file mode 100644 index 00000000000..2ed177cc964 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java @@ -0,0 +1,386 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Repository + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Repository { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public static final String SERIALIZED_NAME_DEFAULT_BRANCH = "default_branch"; + @SerializedName(SERIALIZED_NAME_DEFAULT_BRANCH) + private String defaultBranch; + + public static final String SERIALIZED_NAME_STORAGE_NAMESPACE = "storage_namespace"; + @SerializedName(SERIALIZED_NAME_STORAGE_NAMESPACE) + private String storageNamespace; + + public Repository() { + } + + public Repository id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Repository creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public Repository defaultBranch(String defaultBranch) { + + this.defaultBranch = defaultBranch; + return this; + } + + /** + * Get defaultBranch + * @return defaultBranch + **/ + @javax.annotation.Nonnull + public String getDefaultBranch() { + return defaultBranch; + } + + + public void setDefaultBranch(String defaultBranch) { + this.defaultBranch = defaultBranch; + } + + + public Repository storageNamespace(String storageNamespace) { + + this.storageNamespace = storageNamespace; + return this; + } + + /** + * Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") + * @return storageNamespace + **/ + @javax.annotation.Nonnull + public String getStorageNamespace() { + return storageNamespace; + } + + + public void setStorageNamespace(String storageNamespace) { + this.storageNamespace = storageNamespace; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Repository instance itself + */ + public Repository putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Repository repository = (Repository) o; + return Objects.equals(this.id, repository.id) && + Objects.equals(this.creationDate, repository.creationDate) && + Objects.equals(this.defaultBranch, repository.defaultBranch) && + Objects.equals(this.storageNamespace, repository.storageNamespace)&& + Objects.equals(this.additionalProperties, repository.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, defaultBranch, storageNamespace, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Repository {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" defaultBranch: ").append(toIndentedString(defaultBranch)).append("\n"); + sb.append(" storageNamespace: ").append(toIndentedString(storageNamespace)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("creation_date"); + openapiFields.add("default_branch"); + openapiFields.add("storage_namespace"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("creation_date"); + openapiRequiredFields.add("default_branch"); + openapiRequiredFields.add("storage_namespace"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Repository + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Repository.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Repository is not found in the empty JSON string", Repository.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Repository.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("default_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_branch").toString())); + } + if (!jsonObj.get("storage_namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Repository.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Repository' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Repository.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Repository value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Repository read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Repository instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Repository given an JSON string + * + * @param jsonString JSON string + * @return An instance of Repository + * @throws IOException if the JSON string is invalid with respect to Repository + */ + public static Repository fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Repository.class); + } + + /** + * Convert an instance of Repository to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java new file mode 100644 index 00000000000..6cb68ec86ba --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java @@ -0,0 +1,384 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RepositoryCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RepositoryCreation { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_STORAGE_NAMESPACE = "storage_namespace"; + @SerializedName(SERIALIZED_NAME_STORAGE_NAMESPACE) + private String storageNamespace; + + public static final String SERIALIZED_NAME_DEFAULT_BRANCH = "default_branch"; + @SerializedName(SERIALIZED_NAME_DEFAULT_BRANCH) + private String defaultBranch; + + public static final String SERIALIZED_NAME_SAMPLE_DATA = "sample_data"; + @SerializedName(SERIALIZED_NAME_SAMPLE_DATA) + private Boolean sampleData = false; + + public RepositoryCreation() { + } + + public RepositoryCreation name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public RepositoryCreation storageNamespace(String storageNamespace) { + + this.storageNamespace = storageNamespace; + return this; + } + + /** + * Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") + * @return storageNamespace + **/ + @javax.annotation.Nonnull + public String getStorageNamespace() { + return storageNamespace; + } + + + public void setStorageNamespace(String storageNamespace) { + this.storageNamespace = storageNamespace; + } + + + public RepositoryCreation defaultBranch(String defaultBranch) { + + this.defaultBranch = defaultBranch; + return this; + } + + /** + * Get defaultBranch + * @return defaultBranch + **/ + @javax.annotation.Nullable + public String getDefaultBranch() { + return defaultBranch; + } + + + public void setDefaultBranch(String defaultBranch) { + this.defaultBranch = defaultBranch; + } + + + public RepositoryCreation sampleData(Boolean sampleData) { + + this.sampleData = sampleData; + return this; + } + + /** + * Get sampleData + * @return sampleData + **/ + @javax.annotation.Nullable + public Boolean getSampleData() { + return sampleData; + } + + + public void setSampleData(Boolean sampleData) { + this.sampleData = sampleData; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RepositoryCreation instance itself + */ + public RepositoryCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepositoryCreation repositoryCreation = (RepositoryCreation) o; + return Objects.equals(this.name, repositoryCreation.name) && + Objects.equals(this.storageNamespace, repositoryCreation.storageNamespace) && + Objects.equals(this.defaultBranch, repositoryCreation.defaultBranch) && + Objects.equals(this.sampleData, repositoryCreation.sampleData)&& + Objects.equals(this.additionalProperties, repositoryCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, storageNamespace, defaultBranch, sampleData, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepositoryCreation {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" storageNamespace: ").append(toIndentedString(storageNamespace)).append("\n"); + sb.append(" defaultBranch: ").append(toIndentedString(defaultBranch)).append("\n"); + sb.append(" sampleData: ").append(toIndentedString(sampleData)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("storage_namespace"); + openapiFields.add("default_branch"); + openapiFields.add("sample_data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("storage_namespace"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RepositoryCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RepositoryCreation is not found in the empty JSON string", RepositoryCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RepositoryCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("storage_namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_namespace").toString())); + } + if ((jsonObj.get("default_branch") != null && !jsonObj.get("default_branch").isJsonNull()) && !jsonObj.get("default_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_branch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RepositoryCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RepositoryCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RepositoryCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RepositoryCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RepositoryCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RepositoryCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RepositoryCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryCreation + * @throws IOException if the JSON string is invalid with respect to RepositoryCreation + */ + public static RepositoryCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RepositoryCreation.class); + } + + /** + * Convert an instance of RepositoryCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java new file mode 100644 index 00000000000..13b300d5db8 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Repository; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RepositoryList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RepositoryList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public RepositoryList() { + } + + public RepositoryList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public RepositoryList results(List results) { + + this.results = results; + return this; + } + + public RepositoryList addResultsItem(Repository resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RepositoryList instance itself + */ + public RepositoryList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepositoryList repositoryList = (RepositoryList) o; + return Objects.equals(this.pagination, repositoryList.pagination) && + Objects.equals(this.results, repositoryList.results)&& + Objects.equals(this.additionalProperties, repositoryList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepositoryList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RepositoryList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RepositoryList is not found in the empty JSON string", RepositoryList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RepositoryList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + Repository.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RepositoryList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RepositoryList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RepositoryList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RepositoryList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RepositoryList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RepositoryList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RepositoryList given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryList + * @throws IOException if the JSON string is invalid with respect to RepositoryList + */ + public static RepositoryList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RepositoryList.class); + } + + /** + * Convert an instance of RepositoryList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java new file mode 100644 index 00000000000..8ff62b52603 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java @@ -0,0 +1,373 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * ResetCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ResetCreation { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + OBJECT("object"), + + COMMON_PREFIX("common_prefix"), + + RESET("reset"); + + 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 ResetCreation() { + } + + public ResetCreation type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public ResetCreation path(String path) { + + this.path = path; + return this; + } + + /** + * Get path + * @return path + **/ + @javax.annotation.Nullable + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetCreation instance itself + */ + public ResetCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetCreation resetCreation = (ResetCreation) o; + return Objects.equals(this.type, resetCreation.type) && + Objects.equals(this.path, resetCreation.path)&& + Objects.equals(this.additionalProperties, resetCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, path, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetCreation {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("path"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ResetCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetCreation is not found in the empty JSON string", ResetCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ResetCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ResetCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetCreation + * @throws IOException if the JSON string is invalid with respect to ResetCreation + */ + public static ResetCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetCreation.class); + } + + /** + * Convert an instance of ResetCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java new file mode 100644 index 00000000000..c2485b44d74 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java @@ -0,0 +1,322 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * RevertCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RevertCreation { + public static final String SERIALIZED_NAME_REF = "ref"; + @SerializedName(SERIALIZED_NAME_REF) + private String ref; + + public static final String SERIALIZED_NAME_PARENT_NUMBER = "parent_number"; + @SerializedName(SERIALIZED_NAME_PARENT_NUMBER) + private Integer parentNumber; + + public RevertCreation() { + } + + public RevertCreation ref(String ref) { + + this.ref = ref; + return this; + } + + /** + * the commit to revert, given by a ref + * @return ref + **/ + @javax.annotation.Nonnull + public String getRef() { + return ref; + } + + + public void setRef(String ref) { + this.ref = ref; + } + + + public RevertCreation parentNumber(Integer parentNumber) { + + this.parentNumber = parentNumber; + return this; + } + + /** + * when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. + * @return parentNumber + **/ + @javax.annotation.Nonnull + public Integer getParentNumber() { + return parentNumber; + } + + + public void setParentNumber(Integer parentNumber) { + this.parentNumber = parentNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RevertCreation instance itself + */ + public RevertCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevertCreation revertCreation = (RevertCreation) o; + return Objects.equals(this.ref, revertCreation.ref) && + Objects.equals(this.parentNumber, revertCreation.parentNumber)&& + Objects.equals(this.additionalProperties, revertCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ref, parentNumber, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RevertCreation {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" parentNumber: ").append(toIndentedString(parentNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ref"); + openapiFields.add("parent_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ref"); + openapiRequiredFields.add("parent_number"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RevertCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RevertCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RevertCreation is not found in the empty JSON string", RevertCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RevertCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ref").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RevertCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RevertCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RevertCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RevertCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RevertCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RevertCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RevertCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of RevertCreation + * @throws IOException if the JSON string is invalid with respect to RevertCreation + */ + public static RevertCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RevertCreation.class); + } + + /** + * Convert an instance of RevertCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java new file mode 100644 index 00000000000..df056b55d8f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java @@ -0,0 +1,326 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.AccessKeyCredentials; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Setup + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Setup { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private AccessKeyCredentials key; + + public Setup() { + } + + public Setup username(String username) { + + this.username = username; + return this; + } + + /** + * an identifier for the user (e.g. jane.doe) + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public Setup key(AccessKeyCredentials key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public AccessKeyCredentials getKey() { + return key; + } + + + public void setKey(AccessKeyCredentials key) { + this.key = key; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Setup instance itself + */ + public Setup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Setup setup = (Setup) o; + return Objects.equals(this.username, setup.username) && + Objects.equals(this.key, setup.key)&& + Objects.equals(this.additionalProperties, setup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, key, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Setup {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Setup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Setup.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Setup is not found in the empty JSON string", Setup.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Setup.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + // validate the optional field `key` + if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) { + AccessKeyCredentials.validateJsonElement(jsonObj.get("key")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Setup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Setup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Setup.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Setup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Setup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Setup instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Setup given an JSON string + * + * @param jsonString JSON string + * @return An instance of Setup + * @throws IOException if the JSON string is invalid with respect to Setup + */ + public static Setup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Setup.class); + } + + /** + * Convert an instance of Setup to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java new file mode 100644 index 00000000000..167d2203d25 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java @@ -0,0 +1,393 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.LoginConfig; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * SetupState + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetupState { + /** + * Gets or Sets state + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + INITIALIZED("initialized"), + + NOT_INITIALIZED("not_initialized"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.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 StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public static final String SERIALIZED_NAME_COMM_PREFS_MISSING = "comm_prefs_missing"; + @SerializedName(SERIALIZED_NAME_COMM_PREFS_MISSING) + private Boolean commPrefsMissing; + + public static final String SERIALIZED_NAME_LOGIN_CONFIG = "login_config"; + @SerializedName(SERIALIZED_NAME_LOGIN_CONFIG) + private LoginConfig loginConfig; + + public SetupState() { + } + + public SetupState state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + public StateEnum getState() { + return state; + } + + + public void setState(StateEnum state) { + this.state = state; + } + + + public SetupState commPrefsMissing(Boolean commPrefsMissing) { + + this.commPrefsMissing = commPrefsMissing; + return this; + } + + /** + * true if the comm prefs are missing. + * @return commPrefsMissing + **/ + @javax.annotation.Nullable + public Boolean getCommPrefsMissing() { + return commPrefsMissing; + } + + + public void setCommPrefsMissing(Boolean commPrefsMissing) { + this.commPrefsMissing = commPrefsMissing; + } + + + public SetupState loginConfig(LoginConfig loginConfig) { + + this.loginConfig = loginConfig; + return this; + } + + /** + * Get loginConfig + * @return loginConfig + **/ + @javax.annotation.Nullable + public LoginConfig getLoginConfig() { + return loginConfig; + } + + + public void setLoginConfig(LoginConfig loginConfig) { + this.loginConfig = loginConfig; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetupState instance itself + */ + public SetupState putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetupState setupState = (SetupState) o; + return Objects.equals(this.state, setupState.state) && + Objects.equals(this.commPrefsMissing, setupState.commPrefsMissing) && + Objects.equals(this.loginConfig, setupState.loginConfig)&& + Objects.equals(this.additionalProperties, setupState.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(state, commPrefsMissing, loginConfig, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetupState {\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" commPrefsMissing: ").append(toIndentedString(commPrefsMissing)).append("\n"); + sb.append(" loginConfig: ").append(toIndentedString(loginConfig)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("state"); + openapiFields.add("comm_prefs_missing"); + openapiFields.add("login_config"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SetupState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetupState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetupState is not found in the empty JSON string", SetupState.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // validate the optional field `login_config` + if (jsonObj.get("login_config") != null && !jsonObj.get("login_config").isJsonNull()) { + LoginConfig.validateJsonElement(jsonObj.get("login_config")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetupState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetupState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetupState.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetupState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetupState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetupState instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetupState given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetupState + * @throws IOException if the JSON string is invalid with respect to SetupState + */ + public static SetupState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetupState.class); + } + + /** + * Convert an instance of SetupState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java new file mode 100644 index 00000000000..b33b39edd4e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java @@ -0,0 +1,395 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * location for placing an object when staging it + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StagingLocation { + public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; + @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) + private String physicalAddress; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_PRESIGNED_URL = "presigned_url"; + @SerializedName(SERIALIZED_NAME_PRESIGNED_URL) + private String presignedUrl; + + public static final String SERIALIZED_NAME_PRESIGNED_URL_EXPIRY = "presigned_url_expiry"; + @SerializedName(SERIALIZED_NAME_PRESIGNED_URL_EXPIRY) + private Long presignedUrlExpiry; + + public StagingLocation() { + } + + public StagingLocation physicalAddress(String physicalAddress) { + + this.physicalAddress = physicalAddress; + return this; + } + + /** + * Get physicalAddress + * @return physicalAddress + **/ + @javax.annotation.Nullable + public String getPhysicalAddress() { + return physicalAddress; + } + + + public void setPhysicalAddress(String physicalAddress) { + this.physicalAddress = physicalAddress; + } + + + public StagingLocation token(String token) { + + this.token = token; + return this; + } + + /** + * opaque staging token to use to link uploaded object + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + + public void setToken(String token) { + this.token = token; + } + + + public StagingLocation presignedUrl(String presignedUrl) { + + this.presignedUrl = presignedUrl; + return this; + } + + /** + * if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading + * @return presignedUrl + **/ + @javax.annotation.Nullable + public String getPresignedUrl() { + return presignedUrl; + } + + + public void setPresignedUrl(String presignedUrl) { + this.presignedUrl = presignedUrl; + } + + + public StagingLocation presignedUrlExpiry(Long presignedUrlExpiry) { + + this.presignedUrlExpiry = presignedUrlExpiry; + return this; + } + + /** + * If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. + * @return presignedUrlExpiry + **/ + @javax.annotation.Nullable + public Long getPresignedUrlExpiry() { + return presignedUrlExpiry; + } + + + public void setPresignedUrlExpiry(Long presignedUrlExpiry) { + this.presignedUrlExpiry = presignedUrlExpiry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StagingLocation instance itself + */ + public StagingLocation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StagingLocation stagingLocation = (StagingLocation) o; + return Objects.equals(this.physicalAddress, stagingLocation.physicalAddress) && + Objects.equals(this.token, stagingLocation.token) && + Objects.equals(this.presignedUrl, stagingLocation.presignedUrl) && + Objects.equals(this.presignedUrlExpiry, stagingLocation.presignedUrlExpiry)&& + Objects.equals(this.additionalProperties, stagingLocation.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(physicalAddress, token, presignedUrl, presignedUrlExpiry, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StagingLocation {\n"); + sb.append(" physicalAddress: ").append(toIndentedString(physicalAddress)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" presignedUrl: ").append(toIndentedString(presignedUrl)).append("\n"); + sb.append(" presignedUrlExpiry: ").append(toIndentedString(presignedUrlExpiry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("physical_address"); + openapiFields.add("token"); + openapiFields.add("presigned_url"); + openapiFields.add("presigned_url_expiry"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StagingLocation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StagingLocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StagingLocation is not found in the empty JSON string", StagingLocation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StagingLocation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("physical_address") != null && !jsonObj.get("physical_address").isJsonNull()) && !jsonObj.get("physical_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `physical_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("physical_address").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if ((jsonObj.get("presigned_url") != null && !jsonObj.get("presigned_url").isJsonNull()) && !jsonObj.get("presigned_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `presigned_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("presigned_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StagingLocation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StagingLocation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StagingLocation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StagingLocation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StagingLocation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StagingLocation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StagingLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of StagingLocation + * @throws IOException if the JSON string is invalid with respect to StagingLocation + */ + public static StagingLocation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StagingLocation.class); + } + + /** + * Convert an instance of StagingLocation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java new file mode 100644 index 00000000000..356cf9c252d --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java @@ -0,0 +1,423 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.StagingLocation; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * information about uploaded object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StagingMetadata { + public static final String SERIALIZED_NAME_STAGING = "staging"; + @SerializedName(SERIALIZED_NAME_STAGING) + private StagingLocation staging; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + @SerializedName(SERIALIZED_NAME_CHECKSUM) + private String checksum; + + public static final String SERIALIZED_NAME_SIZE_BYTES = "size_bytes"; + @SerializedName(SERIALIZED_NAME_SIZE_BYTES) + private Long sizeBytes; + + public static final String SERIALIZED_NAME_USER_METADATA = "user_metadata"; + @SerializedName(SERIALIZED_NAME_USER_METADATA) + private Map userMetadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_CONTENT_TYPE = "content_type"; + @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + private String contentType; + + public StagingMetadata() { + } + + public StagingMetadata staging(StagingLocation staging) { + + this.staging = staging; + return this; + } + + /** + * Get staging + * @return staging + **/ + @javax.annotation.Nonnull + public StagingLocation getStaging() { + return staging; + } + + + public void setStaging(StagingLocation staging) { + this.staging = staging; + } + + + public StagingMetadata checksum(String checksum) { + + this.checksum = checksum; + return this; + } + + /** + * unique identifier of object content on backing store (typically ETag) + * @return checksum + **/ + @javax.annotation.Nonnull + public String getChecksum() { + return checksum; + } + + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + + public StagingMetadata sizeBytes(Long sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Get sizeBytes + * @return sizeBytes + **/ + @javax.annotation.Nonnull + public Long getSizeBytes() { + return sizeBytes; + } + + + public void setSizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + + public StagingMetadata userMetadata(Map userMetadata) { + + this.userMetadata = userMetadata; + return this; + } + + public StagingMetadata putUserMetadataItem(String key, String userMetadataItem) { + if (this.userMetadata == null) { + this.userMetadata = new HashMap<>(); + } + this.userMetadata.put(key, userMetadataItem); + return this; + } + + /** + * Get userMetadata + * @return userMetadata + **/ + @javax.annotation.Nullable + public Map getUserMetadata() { + return userMetadata; + } + + + public void setUserMetadata(Map userMetadata) { + this.userMetadata = userMetadata; + } + + + public StagingMetadata contentType(String contentType) { + + this.contentType = contentType; + return this; + } + + /** + * Object media type + * @return contentType + **/ + @javax.annotation.Nullable + public String getContentType() { + return contentType; + } + + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StagingMetadata instance itself + */ + public StagingMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StagingMetadata stagingMetadata = (StagingMetadata) o; + return Objects.equals(this.staging, stagingMetadata.staging) && + Objects.equals(this.checksum, stagingMetadata.checksum) && + Objects.equals(this.sizeBytes, stagingMetadata.sizeBytes) && + Objects.equals(this.userMetadata, stagingMetadata.userMetadata) && + Objects.equals(this.contentType, stagingMetadata.contentType)&& + Objects.equals(this.additionalProperties, stagingMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(staging, checksum, sizeBytes, userMetadata, contentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StagingMetadata {\n"); + sb.append(" staging: ").append(toIndentedString(staging)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" userMetadata: ").append(toIndentedString(userMetadata)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("staging"); + openapiFields.add("checksum"); + openapiFields.add("size_bytes"); + openapiFields.add("user_metadata"); + openapiFields.add("content_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("staging"); + openapiRequiredFields.add("checksum"); + openapiRequiredFields.add("size_bytes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StagingMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StagingMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StagingMetadata is not found in the empty JSON string", StagingMetadata.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StagingMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `staging` + StagingLocation.validateJsonElement(jsonObj.get("staging")); + if (!jsonObj.get("checksum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checksum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checksum").toString())); + } + if ((jsonObj.get("content_type") != null && !jsonObj.get("content_type").isJsonNull()) && !jsonObj.get("content_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `content_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StagingMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StagingMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StagingMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StagingMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StagingMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StagingMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StagingMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of StagingMetadata + * @throws IOException if the JSON string is invalid with respect to StagingMetadata + */ + public static StagingMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StagingMetadata.class); + } + + /** + * Convert an instance of StagingMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java new file mode 100644 index 00000000000..3f5d579fb49 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java @@ -0,0 +1,417 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * Statement + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Statement { + /** + * Gets or Sets effect + */ + @JsonAdapter(EffectEnum.Adapter.class) + public enum EffectEnum { + ALLOW("allow"), + + DENY("deny"); + + private String value; + + EffectEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EffectEnum fromValue(String value) { + for (EffectEnum b : EffectEnum.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 EffectEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EffectEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EffectEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_EFFECT = "effect"; + @SerializedName(SERIALIZED_NAME_EFFECT) + private EffectEnum effect; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + @SerializedName(SERIALIZED_NAME_RESOURCE) + private String resource; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private List action = new ArrayList<>(); + + public Statement() { + } + + public Statement effect(EffectEnum effect) { + + this.effect = effect; + return this; + } + + /** + * Get effect + * @return effect + **/ + @javax.annotation.Nonnull + public EffectEnum getEffect() { + return effect; + } + + + public void setEffect(EffectEnum effect) { + this.effect = effect; + } + + + public Statement resource(String resource) { + + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @javax.annotation.Nonnull + public String getResource() { + return resource; + } + + + public void setResource(String resource) { + this.resource = resource; + } + + + public Statement action(List action) { + + this.action = action; + return this; + } + + public Statement addActionItem(String actionItem) { + if (this.action == null) { + this.action = new ArrayList<>(); + } + this.action.add(actionItem); + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nonnull + public List getAction() { + return action; + } + + + public void setAction(List action) { + this.action = action; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Statement instance itself + */ + public Statement putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Statement statement = (Statement) o; + return Objects.equals(this.effect, statement.effect) && + Objects.equals(this.resource, statement.resource) && + Objects.equals(this.action, statement.action)&& + Objects.equals(this.additionalProperties, statement.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(effect, resource, action, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Statement {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("effect"); + openapiFields.add("resource"); + openapiFields.add("action"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("effect"); + openapiRequiredFields.add("resource"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Statement + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Statement.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Statement is not found in the empty JSON string", Statement.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Statement.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("effect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); + } + if (!jsonObj.get("resource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); + } + // ensure the required json array is present + if (jsonObj.get("action") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("action").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be an array in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Statement.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Statement' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Statement.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Statement value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Statement read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Statement instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Statement given an JSON string + * + * @param jsonString JSON string + * @return An instance of Statement + * @throws IOException if the JSON string is invalid with respect to Statement + */ + public static Statement fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Statement.class); + } + + /** + * Convert an instance of Statement to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java new file mode 100644 index 00000000000..0f804ca6084 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java @@ -0,0 +1,354 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * StatsEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StatsEvent { + public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; + @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) + private String propertyClass; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COUNT = "count"; + @SerializedName(SERIALIZED_NAME_COUNT) + private Integer count; + + public StatsEvent() { + } + + public StatsEvent propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\") + * @return propertyClass + **/ + @javax.annotation.Nonnull + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + public StatsEvent name(String name) { + + this.name = name; + return this; + } + + /** + * stats event name (e.g. \"put_object\", \"create_repository\", \"<experimental-feature-name>\") + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public StatsEvent count(Integer count) { + + this.count = count; + return this; + } + + /** + * number of events of the class and name + * @return count + **/ + @javax.annotation.Nonnull + public Integer getCount() { + return count; + } + + + public void setCount(Integer count) { + this.count = count; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StatsEvent instance itself + */ + public StatsEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatsEvent statsEvent = (StatsEvent) o; + return Objects.equals(this.propertyClass, statsEvent.propertyClass) && + Objects.equals(this.name, statsEvent.name) && + Objects.equals(this.count, statsEvent.count)&& + Objects.equals(this.additionalProperties, statsEvent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass, name, count, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatsEvent {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("class"); + openapiFields.add("name"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("class"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatsEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StatsEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StatsEvent is not found in the empty JSON string", StatsEvent.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StatsEvent.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("class").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatsEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatsEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatsEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StatsEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StatsEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StatsEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StatsEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatsEvent + * @throws IOException if the JSON string is invalid with respect to StatsEvent + */ + public static StatsEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatsEvent.class); + } + + /** + * Convert an instance of StatsEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java new file mode 100644 index 00000000000..8311659a4d9 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java @@ -0,0 +1,311 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.StatsEvent; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * StatsEventsList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StatsEventsList { + public static final String SERIALIZED_NAME_EVENTS = "events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + private List events = new ArrayList<>(); + + public StatsEventsList() { + } + + public StatsEventsList events(List events) { + + this.events = events; + return this; + } + + public StatsEventsList addEventsItem(StatsEvent eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @javax.annotation.Nonnull + public List getEvents() { + return events; + } + + + public void setEvents(List events) { + this.events = events; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StatsEventsList instance itself + */ + public StatsEventsList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatsEventsList statsEventsList = (StatsEventsList) o; + return Objects.equals(this.events, statsEventsList.events)&& + Objects.equals(this.additionalProperties, statsEventsList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(events, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatsEventsList {\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("events"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("events"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatsEventsList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StatsEventsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StatsEventsList is not found in the empty JSON string", StatsEventsList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StatsEventsList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); + } + + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); + // validate the required field `events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + StatsEvent.validateJsonElement(jsonArrayevents.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatsEventsList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatsEventsList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatsEventsList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StatsEventsList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StatsEventsList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StatsEventsList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StatsEventsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatsEventsList + * @throws IOException if the JSON string is invalid with respect to StatsEventsList + */ + public static StatsEventsList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatsEventsList.class); + } + + /** + * Convert an instance of StatsEventsList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java new file mode 100644 index 00000000000..93848e5166f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java @@ -0,0 +1,507 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * StorageConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StorageConfig { + public static final String SERIALIZED_NAME_BLOCKSTORE_TYPE = "blockstore_type"; + @SerializedName(SERIALIZED_NAME_BLOCKSTORE_TYPE) + private String blockstoreType; + + public static final String SERIALIZED_NAME_BLOCKSTORE_NAMESPACE_EXAMPLE = "blockstore_namespace_example"; + @SerializedName(SERIALIZED_NAME_BLOCKSTORE_NAMESPACE_EXAMPLE) + private String blockstoreNamespaceExample; + + public static final String SERIALIZED_NAME_BLOCKSTORE_NAMESPACE_VALIDITY_REGEX = "blockstore_namespace_ValidityRegex"; + @SerializedName(SERIALIZED_NAME_BLOCKSTORE_NAMESPACE_VALIDITY_REGEX) + private String blockstoreNamespaceValidityRegex; + + public static final String SERIALIZED_NAME_DEFAULT_NAMESPACE_PREFIX = "default_namespace_prefix"; + @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESPACE_PREFIX) + private String defaultNamespacePrefix; + + public static final String SERIALIZED_NAME_PRE_SIGN_SUPPORT = "pre_sign_support"; + @SerializedName(SERIALIZED_NAME_PRE_SIGN_SUPPORT) + private Boolean preSignSupport; + + public static final String SERIALIZED_NAME_PRE_SIGN_SUPPORT_UI = "pre_sign_support_ui"; + @SerializedName(SERIALIZED_NAME_PRE_SIGN_SUPPORT_UI) + private Boolean preSignSupportUi; + + public static final String SERIALIZED_NAME_IMPORT_SUPPORT = "import_support"; + @SerializedName(SERIALIZED_NAME_IMPORT_SUPPORT) + private Boolean importSupport; + + public static final String SERIALIZED_NAME_IMPORT_VALIDITY_REGEX = "import_validity_regex"; + @SerializedName(SERIALIZED_NAME_IMPORT_VALIDITY_REGEX) + private String importValidityRegex; + + public StorageConfig() { + } + + public StorageConfig blockstoreType(String blockstoreType) { + + this.blockstoreType = blockstoreType; + return this; + } + + /** + * Get blockstoreType + * @return blockstoreType + **/ + @javax.annotation.Nonnull + public String getBlockstoreType() { + return blockstoreType; + } + + + public void setBlockstoreType(String blockstoreType) { + this.blockstoreType = blockstoreType; + } + + + public StorageConfig blockstoreNamespaceExample(String blockstoreNamespaceExample) { + + this.blockstoreNamespaceExample = blockstoreNamespaceExample; + return this; + } + + /** + * Get blockstoreNamespaceExample + * @return blockstoreNamespaceExample + **/ + @javax.annotation.Nonnull + public String getBlockstoreNamespaceExample() { + return blockstoreNamespaceExample; + } + + + public void setBlockstoreNamespaceExample(String blockstoreNamespaceExample) { + this.blockstoreNamespaceExample = blockstoreNamespaceExample; + } + + + public StorageConfig blockstoreNamespaceValidityRegex(String blockstoreNamespaceValidityRegex) { + + this.blockstoreNamespaceValidityRegex = blockstoreNamespaceValidityRegex; + return this; + } + + /** + * Get blockstoreNamespaceValidityRegex + * @return blockstoreNamespaceValidityRegex + **/ + @javax.annotation.Nonnull + public String getBlockstoreNamespaceValidityRegex() { + return blockstoreNamespaceValidityRegex; + } + + + public void setBlockstoreNamespaceValidityRegex(String blockstoreNamespaceValidityRegex) { + this.blockstoreNamespaceValidityRegex = blockstoreNamespaceValidityRegex; + } + + + public StorageConfig defaultNamespacePrefix(String defaultNamespacePrefix) { + + this.defaultNamespacePrefix = defaultNamespacePrefix; + return this; + } + + /** + * Get defaultNamespacePrefix + * @return defaultNamespacePrefix + **/ + @javax.annotation.Nullable + public String getDefaultNamespacePrefix() { + return defaultNamespacePrefix; + } + + + public void setDefaultNamespacePrefix(String defaultNamespacePrefix) { + this.defaultNamespacePrefix = defaultNamespacePrefix; + } + + + public StorageConfig preSignSupport(Boolean preSignSupport) { + + this.preSignSupport = preSignSupport; + return this; + } + + /** + * Get preSignSupport + * @return preSignSupport + **/ + @javax.annotation.Nonnull + public Boolean getPreSignSupport() { + return preSignSupport; + } + + + public void setPreSignSupport(Boolean preSignSupport) { + this.preSignSupport = preSignSupport; + } + + + public StorageConfig preSignSupportUi(Boolean preSignSupportUi) { + + this.preSignSupportUi = preSignSupportUi; + return this; + } + + /** + * Get preSignSupportUi + * @return preSignSupportUi + **/ + @javax.annotation.Nonnull + public Boolean getPreSignSupportUi() { + return preSignSupportUi; + } + + + public void setPreSignSupportUi(Boolean preSignSupportUi) { + this.preSignSupportUi = preSignSupportUi; + } + + + public StorageConfig importSupport(Boolean importSupport) { + + this.importSupport = importSupport; + return this; + } + + /** + * Get importSupport + * @return importSupport + **/ + @javax.annotation.Nonnull + public Boolean getImportSupport() { + return importSupport; + } + + + public void setImportSupport(Boolean importSupport) { + this.importSupport = importSupport; + } + + + public StorageConfig importValidityRegex(String importValidityRegex) { + + this.importValidityRegex = importValidityRegex; + return this; + } + + /** + * Get importValidityRegex + * @return importValidityRegex + **/ + @javax.annotation.Nonnull + public String getImportValidityRegex() { + return importValidityRegex; + } + + + public void setImportValidityRegex(String importValidityRegex) { + this.importValidityRegex = importValidityRegex; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StorageConfig instance itself + */ + public StorageConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageConfig storageConfig = (StorageConfig) o; + return Objects.equals(this.blockstoreType, storageConfig.blockstoreType) && + Objects.equals(this.blockstoreNamespaceExample, storageConfig.blockstoreNamespaceExample) && + Objects.equals(this.blockstoreNamespaceValidityRegex, storageConfig.blockstoreNamespaceValidityRegex) && + Objects.equals(this.defaultNamespacePrefix, storageConfig.defaultNamespacePrefix) && + Objects.equals(this.preSignSupport, storageConfig.preSignSupport) && + Objects.equals(this.preSignSupportUi, storageConfig.preSignSupportUi) && + Objects.equals(this.importSupport, storageConfig.importSupport) && + Objects.equals(this.importValidityRegex, storageConfig.importValidityRegex)&& + Objects.equals(this.additionalProperties, storageConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(blockstoreType, blockstoreNamespaceExample, blockstoreNamespaceValidityRegex, defaultNamespacePrefix, preSignSupport, preSignSupportUi, importSupport, importValidityRegex, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageConfig {\n"); + sb.append(" blockstoreType: ").append(toIndentedString(blockstoreType)).append("\n"); + sb.append(" blockstoreNamespaceExample: ").append(toIndentedString(blockstoreNamespaceExample)).append("\n"); + sb.append(" blockstoreNamespaceValidityRegex: ").append(toIndentedString(blockstoreNamespaceValidityRegex)).append("\n"); + sb.append(" defaultNamespacePrefix: ").append(toIndentedString(defaultNamespacePrefix)).append("\n"); + sb.append(" preSignSupport: ").append(toIndentedString(preSignSupport)).append("\n"); + sb.append(" preSignSupportUi: ").append(toIndentedString(preSignSupportUi)).append("\n"); + sb.append(" importSupport: ").append(toIndentedString(importSupport)).append("\n"); + sb.append(" importValidityRegex: ").append(toIndentedString(importValidityRegex)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockstore_type"); + openapiFields.add("blockstore_namespace_example"); + openapiFields.add("blockstore_namespace_ValidityRegex"); + openapiFields.add("default_namespace_prefix"); + openapiFields.add("pre_sign_support"); + openapiFields.add("pre_sign_support_ui"); + openapiFields.add("import_support"); + openapiFields.add("import_validity_regex"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockstore_type"); + openapiRequiredFields.add("blockstore_namespace_example"); + openapiRequiredFields.add("blockstore_namespace_ValidityRegex"); + openapiRequiredFields.add("pre_sign_support"); + openapiRequiredFields.add("pre_sign_support_ui"); + openapiRequiredFields.add("import_support"); + openapiRequiredFields.add("import_validity_regex"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageConfig is not found in the empty JSON string", StorageConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("blockstore_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockstore_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockstore_type").toString())); + } + if (!jsonObj.get("blockstore_namespace_example").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockstore_namespace_example` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockstore_namespace_example").toString())); + } + if (!jsonObj.get("blockstore_namespace_ValidityRegex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockstore_namespace_ValidityRegex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockstore_namespace_ValidityRegex").toString())); + } + if ((jsonObj.get("default_namespace_prefix") != null && !jsonObj.get("default_namespace_prefix").isJsonNull()) && !jsonObj.get("default_namespace_prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_namespace_prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_namespace_prefix").toString())); + } + if (!jsonObj.get("import_validity_regex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `import_validity_regex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("import_validity_regex").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StorageConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StorageConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageConfig + * @throws IOException if the JSON string is invalid with respect to StorageConfig + */ + public static StorageConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageConfig.class); + } + + /** + * Convert an instance of StorageConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java new file mode 100644 index 00000000000..43b25ca366b --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StorageURI { + public static final String SERIALIZED_NAME_LOCATION = "location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + private String location; + + public StorageURI() { + } + + public StorageURI location(String location) { + + this.location = location; + return this; + } + + /** + * Get location + * @return location + **/ + @javax.annotation.Nonnull + public String getLocation() { + return location; + } + + + public void setLocation(String location) { + this.location = location; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StorageURI instance itself + */ + public StorageURI putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageURI storageURI = (StorageURI) o; + return Objects.equals(this.location, storageURI.location)&& + Objects.equals(this.additionalProperties, storageURI.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(location, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageURI {\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("location"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("location"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageURI + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageURI.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageURI is not found in the empty JSON string", StorageURI.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageURI.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("location").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageURI.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageURI' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageURI.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageURI value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StorageURI read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StorageURI instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageURI given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageURI + * @throws IOException if the JSON string is invalid with respect to StorageURI + */ + public static StorageURI fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageURI.class); + } + + /** + * Convert an instance of StorageURI to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java new file mode 100644 index 00000000000..431590b41ff --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java @@ -0,0 +1,325 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * TagCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TagCreation { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REF = "ref"; + @SerializedName(SERIALIZED_NAME_REF) + private String ref; + + public TagCreation() { + } + + public TagCreation id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TagCreation ref(String ref) { + + this.ref = ref; + return this; + } + + /** + * Get ref + * @return ref + **/ + @javax.annotation.Nonnull + public String getRef() { + return ref; + } + + + public void setRef(String ref) { + this.ref = ref; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TagCreation instance itself + */ + public TagCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TagCreation tagCreation = (TagCreation) o; + return Objects.equals(this.id, tagCreation.id) && + Objects.equals(this.ref, tagCreation.ref)&& + Objects.equals(this.additionalProperties, tagCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, ref, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TagCreation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("ref"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("ref"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TagCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TagCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TagCreation is not found in the empty JSON string", TagCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TagCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("ref").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TagCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TagCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TagCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TagCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TagCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TagCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TagCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of TagCreation + * @throws IOException if the JSON string is invalid with respect to TagCreation + */ + public static TagCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TagCreation.class); + } + + /** + * Convert an instance of TagCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java new file mode 100644 index 00000000000..c603ea28623 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java @@ -0,0 +1,297 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * UnderlyingObjectProperties + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UnderlyingObjectProperties { + public static final String SERIALIZED_NAME_STORAGE_CLASS = "storage_class"; + @SerializedName(SERIALIZED_NAME_STORAGE_CLASS) + private String storageClass; + + public UnderlyingObjectProperties() { + } + + public UnderlyingObjectProperties storageClass(String storageClass) { + + this.storageClass = storageClass; + return this; + } + + /** + * Get storageClass + * @return storageClass + **/ + @javax.annotation.Nullable + public String getStorageClass() { + return storageClass; + } + + + public void setStorageClass(String storageClass) { + this.storageClass = storageClass; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UnderlyingObjectProperties instance itself + */ + public UnderlyingObjectProperties putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnderlyingObjectProperties underlyingObjectProperties = (UnderlyingObjectProperties) o; + return Objects.equals(this.storageClass, underlyingObjectProperties.storageClass)&& + Objects.equals(this.additionalProperties, underlyingObjectProperties.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(storageClass, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnderlyingObjectProperties {\n"); + sb.append(" storageClass: ").append(toIndentedString(storageClass)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("storage_class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UnderlyingObjectProperties + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UnderlyingObjectProperties.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UnderlyingObjectProperties is not found in the empty JSON string", UnderlyingObjectProperties.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("storage_class") != null && !jsonObj.get("storage_class").isJsonNull()) && !jsonObj.get("storage_class").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_class").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UnderlyingObjectProperties.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UnderlyingObjectProperties' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UnderlyingObjectProperties.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UnderlyingObjectProperties value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UnderlyingObjectProperties read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UnderlyingObjectProperties instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UnderlyingObjectProperties given an JSON string + * + * @param jsonString JSON string + * @return An instance of UnderlyingObjectProperties + * @throws IOException if the JSON string is invalid with respect to UnderlyingObjectProperties + */ + public static UnderlyingObjectProperties fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UnderlyingObjectProperties.class); + } + + /** + * Convert an instance of UnderlyingObjectProperties to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java new file mode 100644 index 00000000000..e0048e85c62 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java @@ -0,0 +1,293 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * UpdateToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateToken { + public static final String SERIALIZED_NAME_STAGING_TOKEN = "staging_token"; + @SerializedName(SERIALIZED_NAME_STAGING_TOKEN) + private String stagingToken; + + public UpdateToken() { + } + + public UpdateToken stagingToken(String stagingToken) { + + this.stagingToken = stagingToken; + return this; + } + + /** + * Get stagingToken + * @return stagingToken + **/ + @javax.annotation.Nonnull + public String getStagingToken() { + return stagingToken; + } + + + public void setStagingToken(String stagingToken) { + this.stagingToken = stagingToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateToken instance itself + */ + public UpdateToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateToken updateToken = (UpdateToken) o; + return Objects.equals(this.stagingToken, updateToken.stagingToken)&& + Objects.equals(this.additionalProperties, updateToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(stagingToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateToken {\n"); + sb.append(" stagingToken: ").append(toIndentedString(stagingToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("staging_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("staging_token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateToken is not found in the empty JSON string", UpdateToken.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateToken.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("staging_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `staging_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("staging_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateToken + * @throws IOException if the JSON string is invalid with respect to UpdateToken + */ + public static UpdateToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateToken.class); + } + + /** + * Convert an instance of UpdateToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java new file mode 100644 index 00000000000..3b90980034f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java @@ -0,0 +1,353 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * User + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class User { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creation_date"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private Long creationDate; + + public static final String SERIALIZED_NAME_FRIENDLY_NAME = "friendly_name"; + @SerializedName(SERIALIZED_NAME_FRIENDLY_NAME) + private String friendlyName; + + public User() { + } + + public User id(String id) { + + this.id = id; + return this; + } + + /** + * a unique identifier for the user. + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public User creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Unix Epoch in seconds + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public User friendlyName(String friendlyName) { + + this.friendlyName = friendlyName; + return this; + } + + /** + * Get friendlyName + * @return friendlyName + **/ + @javax.annotation.Nullable + public String getFriendlyName() { + return friendlyName; + } + + + public void setFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the User instance itself + */ + public User putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.creationDate, user.creationDate) && + Objects.equals(this.friendlyName, user.friendlyName)&& + Objects.equals(this.additionalProperties, user.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, friendlyName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" friendlyName: ").append(toIndentedString(friendlyName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("creation_date"); + openapiFields.add("friendly_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("creation_date"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : User.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("friendly_name") != null && !jsonObj.get("friendly_name").isJsonNull()) && !jsonObj.get("friendly_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `friendly_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("friendly_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + User instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java new file mode 100644 index 00000000000..67a189210aa --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java @@ -0,0 +1,321 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * UserCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserCreation { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_INVITE_USER = "invite_user"; + @SerializedName(SERIALIZED_NAME_INVITE_USER) + private Boolean inviteUser; + + public UserCreation() { + } + + public UserCreation id(String id) { + + this.id = id; + return this; + } + + /** + * a unique identifier for the user. + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public UserCreation inviteUser(Boolean inviteUser) { + + this.inviteUser = inviteUser; + return this; + } + + /** + * Get inviteUser + * @return inviteUser + **/ + @javax.annotation.Nullable + public Boolean getInviteUser() { + return inviteUser; + } + + + public void setInviteUser(Boolean inviteUser) { + this.inviteUser = inviteUser; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserCreation instance itself + */ + public UserCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreation userCreation = (UserCreation) o; + return Objects.equals(this.id, userCreation.id) && + Objects.equals(this.inviteUser, userCreation.inviteUser)&& + Objects.equals(this.additionalProperties, userCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, inviteUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" inviteUser: ").append(toIndentedString(inviteUser)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("invite_user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreation is not found in the empty JSON string", UserCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserCreation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreation + * @throws IOException if the JSON string is invalid with respect to UserCreation + */ + public static UserCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreation.class); + } + + /** + * Convert an instance of UserCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java new file mode 100644 index 00000000000..04624ebe200 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * UserList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserList { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public UserList() { + } + + public UserList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public UserList results(List results) { + + this.results = results; + return this; + } + + public UserList addResultsItem(User resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserList instance itself + */ + public UserList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserList userList = (UserList) o; + return Objects.equals(this.pagination, userList.pagination) && + Objects.equals(this.results, userList.results)&& + Objects.equals(this.additionalProperties, userList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserList is not found in the empty JSON string", UserList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `pagination` + Pagination.validateJsonElement(jsonObj.get("pagination")); + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + User.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserList given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserList + * @throws IOException if the JSON string is invalid with respect to UserList + */ + public static UserList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserList.class); + } + + /** + * Convert an instance of UserList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java new file mode 100644 index 00000000000..1c3077d5cf1 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java @@ -0,0 +1,375 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * VersionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VersionConfig { + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_LATEST_VERSION = "latest_version"; + @SerializedName(SERIALIZED_NAME_LATEST_VERSION) + private String latestVersion; + + public static final String SERIALIZED_NAME_UPGRADE_RECOMMENDED = "upgrade_recommended"; + @SerializedName(SERIALIZED_NAME_UPGRADE_RECOMMENDED) + private Boolean upgradeRecommended; + + public static final String SERIALIZED_NAME_UPGRADE_URL = "upgrade_url"; + @SerializedName(SERIALIZED_NAME_UPGRADE_URL) + private String upgradeUrl; + + public VersionConfig() { + } + + public VersionConfig version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public VersionConfig latestVersion(String latestVersion) { + + this.latestVersion = latestVersion; + return this; + } + + /** + * Get latestVersion + * @return latestVersion + **/ + @javax.annotation.Nullable + public String getLatestVersion() { + return latestVersion; + } + + + public void setLatestVersion(String latestVersion) { + this.latestVersion = latestVersion; + } + + + public VersionConfig upgradeRecommended(Boolean upgradeRecommended) { + + this.upgradeRecommended = upgradeRecommended; + return this; + } + + /** + * Get upgradeRecommended + * @return upgradeRecommended + **/ + @javax.annotation.Nullable + public Boolean getUpgradeRecommended() { + return upgradeRecommended; + } + + + public void setUpgradeRecommended(Boolean upgradeRecommended) { + this.upgradeRecommended = upgradeRecommended; + } + + + public VersionConfig upgradeUrl(String upgradeUrl) { + + this.upgradeUrl = upgradeUrl; + return this; + } + + /** + * Get upgradeUrl + * @return upgradeUrl + **/ + @javax.annotation.Nullable + public String getUpgradeUrl() { + return upgradeUrl; + } + + + public void setUpgradeUrl(String upgradeUrl) { + this.upgradeUrl = upgradeUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VersionConfig instance itself + */ + public VersionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionConfig versionConfig = (VersionConfig) o; + return Objects.equals(this.version, versionConfig.version) && + Objects.equals(this.latestVersion, versionConfig.latestVersion) && + Objects.equals(this.upgradeRecommended, versionConfig.upgradeRecommended) && + Objects.equals(this.upgradeUrl, versionConfig.upgradeUrl)&& + Objects.equals(this.additionalProperties, versionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(version, latestVersion, upgradeRecommended, upgradeUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionConfig {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" latestVersion: ").append(toIndentedString(latestVersion)).append("\n"); + sb.append(" upgradeRecommended: ").append(toIndentedString(upgradeRecommended)).append("\n"); + sb.append(" upgradeUrl: ").append(toIndentedString(upgradeUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + openapiFields.add("latest_version"); + openapiFields.add("upgrade_recommended"); + openapiFields.add("upgrade_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to VersionConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VersionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VersionConfig is not found in the empty JSON string", VersionConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("latest_version") != null && !jsonObj.get("latest_version").isJsonNull()) && !jsonObj.get("latest_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latest_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latest_version").toString())); + } + if ((jsonObj.get("upgrade_url") != null && !jsonObj.get("upgrade_url").isJsonNull()) && !jsonObj.get("upgrade_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upgrade_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upgrade_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VersionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VersionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VersionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VersionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VersionConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VersionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VersionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionConfig + * @throws IOException if the JSON string is invalid with respect to VersionConfig + */ + public static VersionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VersionConfig.class); + } + + /** + * Convert an instance of VersionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ActionsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ActionsApiTest.java new file mode 100644 index 00000000000..99b7af686e3 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ActionsApiTest.java @@ -0,0 +1,106 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.ActionRun; +import io.lakefs.clients.sdk.model.ActionRunList; +import io.lakefs.clients.sdk.model.Error; +import java.io.File; +import io.lakefs.clients.sdk.model.HookRunList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ActionsApi + */ +@Disabled +public class ActionsApiTest { + + private final ActionsApi api = new ActionsApi(); + + /** + * get a run + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRunTest() throws ApiException { + String repository = null; + String runId = null; + ActionRun response = api.getRun(repository, runId) + .execute(); + // TODO: test validations + } + + /** + * get run hook output + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRunHookOutputTest() throws ApiException { + String repository = null; + String runId = null; + String hookRunId = null; + File response = api.getRunHookOutput(repository, runId, hookRunId) + .execute(); + // TODO: test validations + } + + /** + * list runs + * + * @throws ApiException if the Api call fails + */ + @Test + public void listRepositoryRunsTest() throws ApiException { + String repository = null; + String after = null; + Integer amount = null; + String branch = null; + String commit = null; + ActionRunList response = api.listRepositoryRuns(repository) + .after(after) + .amount(amount) + .branch(branch) + .commit(commit) + .execute(); + // TODO: test validations + } + + /** + * list run hooks + * + * @throws ApiException if the Api call fails + */ + @Test + public void listRunHooksTest() throws ApiException { + String repository = null; + String runId = null; + String after = null; + Integer amount = null; + HookRunList response = api.listRunHooks(repository, runId) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/AuthApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/AuthApiTest.java new file mode 100644 index 00000000000..2b955de6888 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/AuthApiTest.java @@ -0,0 +1,512 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.ACL; +import io.lakefs.clients.sdk.model.AuthenticationToken; +import io.lakefs.clients.sdk.model.Credentials; +import io.lakefs.clients.sdk.model.CredentialsList; +import io.lakefs.clients.sdk.model.CredentialsWithSecret; +import io.lakefs.clients.sdk.model.CurrentUser; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ErrorNoACL; +import io.lakefs.clients.sdk.model.Group; +import io.lakefs.clients.sdk.model.GroupCreation; +import io.lakefs.clients.sdk.model.GroupList; +import io.lakefs.clients.sdk.model.LoginInformation; +import io.lakefs.clients.sdk.model.Policy; +import io.lakefs.clients.sdk.model.PolicyList; +import io.lakefs.clients.sdk.model.User; +import io.lakefs.clients.sdk.model.UserCreation; +import io.lakefs.clients.sdk.model.UserList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AuthApi + */ +@Disabled +public class AuthApiTest { + + private final AuthApi api = new AuthApi(); + + /** + * add group membership + * + * @throws ApiException if the Api call fails + */ + @Test + public void addGroupMembershipTest() throws ApiException { + String groupId = null; + String userId = null; + api.addGroupMembership(groupId, userId) + .execute(); + // TODO: test validations + } + + /** + * attach policy to group + * + * @throws ApiException if the Api call fails + */ + @Test + public void attachPolicyToGroupTest() throws ApiException { + String groupId = null; + String policyId = null; + api.attachPolicyToGroup(groupId, policyId) + .execute(); + // TODO: test validations + } + + /** + * attach policy to user + * + * @throws ApiException if the Api call fails + */ + @Test + public void attachPolicyToUserTest() throws ApiException { + String userId = null; + String policyId = null; + api.attachPolicyToUser(userId, policyId) + .execute(); + // TODO: test validations + } + + /** + * create credentials + * + * @throws ApiException if the Api call fails + */ + @Test + public void createCredentialsTest() throws ApiException { + String userId = null; + CredentialsWithSecret response = api.createCredentials(userId) + .execute(); + // TODO: test validations + } + + /** + * create group + * + * @throws ApiException if the Api call fails + */ + @Test + public void createGroupTest() throws ApiException { + GroupCreation groupCreation = null; + Group response = api.createGroup() + .groupCreation(groupCreation) + .execute(); + // TODO: test validations + } + + /** + * create policy + * + * @throws ApiException if the Api call fails + */ + @Test + public void createPolicyTest() throws ApiException { + Policy policy = null; + Policy response = api.createPolicy(policy) + .execute(); + // TODO: test validations + } + + /** + * create user + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + UserCreation userCreation = null; + User response = api.createUser() + .userCreation(userCreation) + .execute(); + // TODO: test validations + } + + /** + * delete credentials + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteCredentialsTest() throws ApiException { + String userId = null; + String accessKeyId = null; + api.deleteCredentials(userId, accessKeyId) + .execute(); + // TODO: test validations + } + + /** + * delete group + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteGroupTest() throws ApiException { + String groupId = null; + api.deleteGroup(groupId) + .execute(); + // TODO: test validations + } + + /** + * delete group membership + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteGroupMembershipTest() throws ApiException { + String groupId = null; + String userId = null; + api.deleteGroupMembership(groupId, userId) + .execute(); + // TODO: test validations + } + + /** + * delete policy + * + * @throws ApiException if the Api call fails + */ + @Test + public void deletePolicyTest() throws ApiException { + String policyId = null; + api.deletePolicy(policyId) + .execute(); + // TODO: test validations + } + + /** + * delete user + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String userId = null; + api.deleteUser(userId) + .execute(); + // TODO: test validations + } + + /** + * detach policy from group + * + * @throws ApiException if the Api call fails + */ + @Test + public void detachPolicyFromGroupTest() throws ApiException { + String groupId = null; + String policyId = null; + api.detachPolicyFromGroup(groupId, policyId) + .execute(); + // TODO: test validations + } + + /** + * detach policy from user + * + * @throws ApiException if the Api call fails + */ + @Test + public void detachPolicyFromUserTest() throws ApiException { + String userId = null; + String policyId = null; + api.detachPolicyFromUser(userId, policyId) + .execute(); + // TODO: test validations + } + + /** + * get credentials + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCredentialsTest() throws ApiException { + String userId = null; + String accessKeyId = null; + Credentials response = api.getCredentials(userId, accessKeyId) + .execute(); + // TODO: test validations + } + + /** + * get current user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCurrentUserTest() throws ApiException { + CurrentUser response = api.getCurrentUser() + .execute(); + // TODO: test validations + } + + /** + * get group + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupTest() throws ApiException { + String groupId = null; + Group response = api.getGroup(groupId) + .execute(); + // TODO: test validations + } + + /** + * get ACL of group + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupACLTest() throws ApiException { + String groupId = null; + ACL response = api.getGroupACL(groupId) + .execute(); + // TODO: test validations + } + + /** + * get policy + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPolicyTest() throws ApiException { + String policyId = null; + Policy response = api.getPolicy(policyId) + .execute(); + // TODO: test validations + } + + /** + * get user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserTest() throws ApiException { + String userId = null; + User response = api.getUser(userId) + .execute(); + // TODO: test validations + } + + /** + * list group members + * + * @throws ApiException if the Api call fails + */ + @Test + public void listGroupMembersTest() throws ApiException { + String groupId = null; + String prefix = null; + String after = null; + Integer amount = null; + UserList response = api.listGroupMembers(groupId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list group policies + * + * @throws ApiException if the Api call fails + */ + @Test + public void listGroupPoliciesTest() throws ApiException { + String groupId = null; + String prefix = null; + String after = null; + Integer amount = null; + PolicyList response = api.listGroupPolicies(groupId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list groups + * + * @throws ApiException if the Api call fails + */ + @Test + public void listGroupsTest() throws ApiException { + String prefix = null; + String after = null; + Integer amount = null; + GroupList response = api.listGroups() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list policies + * + * @throws ApiException if the Api call fails + */ + @Test + public void listPoliciesTest() throws ApiException { + String prefix = null; + String after = null; + Integer amount = null; + PolicyList response = api.listPolicies() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list user credentials + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUserCredentialsTest() throws ApiException { + String userId = null; + String prefix = null; + String after = null; + Integer amount = null; + CredentialsList response = api.listUserCredentials(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list user groups + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUserGroupsTest() throws ApiException { + String userId = null; + String prefix = null; + String after = null; + Integer amount = null; + GroupList response = api.listUserGroups(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * list user policies + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUserPoliciesTest() throws ApiException { + String userId = null; + String prefix = null; + String after = null; + Integer amount = null; + Boolean effective = null; + PolicyList response = api.listUserPolicies(userId) + .prefix(prefix) + .after(after) + .amount(amount) + .effective(effective) + .execute(); + // TODO: test validations + } + + /** + * list users + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUsersTest() throws ApiException { + String prefix = null; + String after = null; + Integer amount = null; + UserList response = api.listUsers() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * perform a login + * + * @throws ApiException if the Api call fails + */ + @Test + public void loginTest() throws ApiException { + LoginInformation loginInformation = null; + AuthenticationToken response = api.login() + .loginInformation(loginInformation) + .execute(); + // TODO: test validations + } + + /** + * set ACL of group + * + * @throws ApiException if the Api call fails + */ + @Test + public void setGroupACLTest() throws ApiException { + String groupId = null; + ACL ACL = null; + api.setGroupACL(groupId, ACL) + .execute(); + // TODO: test validations + } + + /** + * update policy + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePolicyTest() throws ApiException { + String policyId = null; + Policy policy = null; + Policy response = api.updatePolicy(policyId, policy) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/BranchesApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/BranchesApiTest.java new file mode 100644 index 00000000000..0938080de23 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/BranchesApiTest.java @@ -0,0 +1,170 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.BranchCreation; +import io.lakefs.clients.sdk.model.CherryPickCreation; +import io.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.DiffList; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Ref; +import io.lakefs.clients.sdk.model.RefList; +import io.lakefs.clients.sdk.model.ResetCreation; +import io.lakefs.clients.sdk.model.RevertCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for BranchesApi + */ +@Disabled +public class BranchesApiTest { + + private final BranchesApi api = new BranchesApi(); + + /** + * Replay the changes from the given commit on the branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void cherryPickTest() throws ApiException { + String repository = null; + String branch = null; + CherryPickCreation cherryPickCreation = null; + Commit response = api.cherryPick(repository, branch, cherryPickCreation) + .execute(); + // TODO: test validations + } + + /** + * create branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void createBranchTest() throws ApiException { + String repository = null; + BranchCreation branchCreation = null; + String response = api.createBranch(repository, branchCreation) + .execute(); + // TODO: test validations + } + + /** + * delete branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteBranchTest() throws ApiException { + String repository = null; + String branch = null; + api.deleteBranch(repository, branch) + .execute(); + // TODO: test validations + } + + /** + * diff branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void diffBranchTest() throws ApiException { + String repository = null; + String branch = null; + String after = null; + Integer amount = null; + String prefix = null; + String delimiter = null; + DiffList response = api.diffBranch(repository, branch) + .after(after) + .amount(amount) + .prefix(prefix) + .delimiter(delimiter) + .execute(); + // TODO: test validations + } + + /** + * get branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBranchTest() throws ApiException { + String repository = null; + String branch = null; + Ref response = api.getBranch(repository, branch) + .execute(); + // TODO: test validations + } + + /** + * list branches + * + * @throws ApiException if the Api call fails + */ + @Test + public void listBranchesTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + RefList response = api.listBranches(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + + /** + * reset branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void resetBranchTest() throws ApiException { + String repository = null; + String branch = null; + ResetCreation resetCreation = null; + api.resetBranch(repository, branch, resetCreation) + .execute(); + // TODO: test validations + } + + /** + * revert + * + * @throws ApiException if the Api call fails + */ + @Test + public void revertBranchTest() throws ApiException { + String repository = null; + String branch = null; + RevertCreation revertCreation = null; + api.revertBranch(repository, branch, revertCreation) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/CommitsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/CommitsApiTest.java new file mode 100644 index 00000000000..bdfac3befd8 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/CommitsApiTest.java @@ -0,0 +1,67 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.CommitCreation; +import io.lakefs.clients.sdk.model.Error; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CommitsApi + */ +@Disabled +public class CommitsApiTest { + + private final CommitsApi api = new CommitsApi(); + + /** + * create commit + * + * @throws ApiException if the Api call fails + */ + @Test + public void commitTest() throws ApiException { + String repository = null; + String branch = null; + CommitCreation commitCreation = null; + String sourceMetarange = null; + Commit response = api.commit(repository, branch, commitCreation) + .sourceMetarange(sourceMetarange) + .execute(); + // TODO: test validations + } + + /** + * get commit + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCommitTest() throws ApiException { + String repository = null; + String commitId = null; + Commit response = api.getCommit(repository, commitId) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ConfigApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ConfigApiTest.java new file mode 100644 index 00000000000..7397835a091 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ConfigApiTest.java @@ -0,0 +1,73 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.GarbageCollectionConfig; +import io.lakefs.clients.sdk.model.StorageConfig; +import io.lakefs.clients.sdk.model.VersionConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ConfigApi + */ +@Disabled +public class ConfigApiTest { + + private final ConfigApi api = new ConfigApi(); + + /** + * get information of gc settings + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGarbageCollectionConfigTest() throws ApiException { + GarbageCollectionConfig response = api.getGarbageCollectionConfig() + .execute(); + // TODO: test validations + } + + /** + * get version of lakeFS server + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLakeFSVersionTest() throws ApiException { + VersionConfig response = api.getLakeFSVersion() + .execute(); + // TODO: test validations + } + + /** + * retrieve lakeFS storage configuration + * + * @throws ApiException if the Api call fails + */ + @Test + public void getStorageConfigTest() throws ApiException { + StorageConfig response = api.getStorageConfig() + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java new file mode 100644 index 00000000000..d86105453b3 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java @@ -0,0 +1,65 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.OTFDiffs; +import io.lakefs.clients.sdk.model.OtfDiffList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ExperimentalApi + */ +@Disabled +public class ExperimentalApiTest { + + private final ExperimentalApi api = new ExperimentalApi(); + + /** + * get the available Open Table Format diffs + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOtfDiffsTest() throws ApiException { + OTFDiffs response = api.getOtfDiffs() + .execute(); + // TODO: test validations + } + + /** + * perform otf diff + * + * @throws ApiException if the Api call fails + */ + @Test + public void otfDiffTest() throws ApiException { + String repository = null; + String leftRef = null; + String rightRef = null; + String tablePath = null; + String type = null; + OtfDiffList response = api.otfDiff(repository, leftRef, rightRef, tablePath, type) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/HealthCheckApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/HealthCheckApiTest.java new file mode 100644 index 00000000000..883322341d7 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/HealthCheckApiTest.java @@ -0,0 +1,45 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for HealthCheckApi + */ +@Disabled +public class HealthCheckApiTest { + + private final HealthCheckApi api = new HealthCheckApi(); + + /** + * check that the API server is up and running + * + * @throws ApiException if the Api call fails + */ + @Test + public void healthCheckTest() throws ApiException { + api.healthCheck() + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ImportApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ImportApiTest.java new file mode 100644 index 00000000000..8014389bf9e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ImportApiTest.java @@ -0,0 +1,82 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ImportCreation; +import io.lakefs.clients.sdk.model.ImportCreationResponse; +import io.lakefs.clients.sdk.model.ImportStatus; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ImportApi + */ +@Disabled +public class ImportApiTest { + + private final ImportApi api = new ImportApi(); + + /** + * cancel ongoing import + * + * @throws ApiException if the Api call fails + */ + @Test + public void importCancelTest() throws ApiException { + String repository = null; + String branch = null; + String id = null; + api.importCancel(repository, branch, id) + .execute(); + // TODO: test validations + } + + /** + * import data from object store + * + * @throws ApiException if the Api call fails + */ + @Test + public void importStartTest() throws ApiException { + String repository = null; + String branch = null; + ImportCreation importCreation = null; + ImportCreationResponse response = api.importStart(repository, branch, importCreation) + .execute(); + // TODO: test validations + } + + /** + * get import status + * + * @throws ApiException if the Api call fails + */ + @Test + public void importStatusTest() throws ApiException { + String repository = null; + String branch = null; + String id = null; + ImportStatus response = api.importStatus(repository, branch, id) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/InternalApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/InternalApiTest.java new file mode 100644 index 00000000000..983a83da153 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/InternalApiTest.java @@ -0,0 +1,155 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.AuthCapabilities; +import io.lakefs.clients.sdk.model.CommPrefsInput; +import io.lakefs.clients.sdk.model.CredentialsWithSecret; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Setup; +import io.lakefs.clients.sdk.model.SetupState; +import io.lakefs.clients.sdk.model.StatsEventsList; +import io.lakefs.clients.sdk.model.StorageURI; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for InternalApi + */ +@Disabled +public class InternalApiTest { + + private final InternalApi api = new InternalApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void createBranchProtectionRulePreflightTest() throws ApiException { + String repository = null; + api.createBranchProtectionRulePreflight(repository) + .execute(); + // TODO: test validations + } + + /** + * creates symlink files corresponding to the given directory + * + * @throws ApiException if the Api call fails + */ + @Test + public void createSymlinkFileTest() throws ApiException { + String repository = null; + String branch = null; + String location = null; + StorageURI response = api.createSymlinkFile(repository, branch) + .location(location) + .execute(); + // TODO: test validations + } + + /** + * list authentication capabilities supported + * + * @throws ApiException if the Api call fails + */ + @Test + public void getAuthCapabilitiesTest() throws ApiException { + AuthCapabilities response = api.getAuthCapabilities() + .execute(); + // TODO: test validations + } + + /** + * check if the lakeFS installation is already set up + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSetupStateTest() throws ApiException { + SetupState response = api.getSetupState() + .execute(); + // TODO: test validations + } + + /** + * post stats events, this endpoint is meant for internal use only + * + * @throws ApiException if the Api call fails + */ + @Test + public void postStatsEventsTest() throws ApiException { + StatsEventsList statsEventsList = null; + api.postStatsEvents(statsEventsList) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void setGarbageCollectionRulesPreflightTest() throws ApiException { + String repository = null; + api.setGarbageCollectionRulesPreflight(repository) + .execute(); + // TODO: test validations + } + + /** + * setup lakeFS and create a first user + * + * @throws ApiException if the Api call fails + */ + @Test + public void setupTest() throws ApiException { + Setup setup = null; + CredentialsWithSecret response = api.setup(setup) + .execute(); + // TODO: test validations + } + + /** + * setup communications preferences + * + * @throws ApiException if the Api call fails + */ + @Test + public void setupCommPrefsTest() throws ApiException { + CommPrefsInput commPrefsInput = null; + api.setupCommPrefs(commPrefsInput) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void uploadObjectPreflightTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + api.uploadObjectPreflight(repository, branch, path) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/MetadataApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/MetadataApiTest.java new file mode 100644 index 00000000000..26552b2a6a9 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/MetadataApiTest.java @@ -0,0 +1,63 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.StorageURI; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for MetadataApi + */ +@Disabled +public class MetadataApiTest { + + private final MetadataApi api = new MetadataApi(); + + /** + * return URI to a meta-range file + * + * @throws ApiException if the Api call fails + */ + @Test + public void getMetaRangeTest() throws ApiException { + String repository = null; + String metaRange = null; + StorageURI response = api.getMetaRange(repository, metaRange) + .execute(); + // TODO: test validations + } + + /** + * return URI to a range file + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRangeTest() throws ApiException { + String repository = null; + String range = null; + StorageURI response = api.getRange(repository, range) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ObjectsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ObjectsApiTest.java new file mode 100644 index 00000000000..715be291bbc --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ObjectsApiTest.java @@ -0,0 +1,219 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import java.io.File; +import io.lakefs.clients.sdk.model.ObjectCopyCreation; +import io.lakefs.clients.sdk.model.ObjectErrorList; +import io.lakefs.clients.sdk.model.ObjectStageCreation; +import io.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.ObjectStatsList; +import io.lakefs.clients.sdk.model.PathList; +import io.lakefs.clients.sdk.model.UnderlyingObjectProperties; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ObjectsApi + */ +@Disabled +public class ObjectsApiTest { + + private final ObjectsApi api = new ObjectsApi(); + + /** + * create a copy of an object + * + * @throws ApiException if the Api call fails + */ + @Test + public void copyObjectTest() throws ApiException { + String repository = null; + String branch = null; + String destPath = null; + ObjectCopyCreation objectCopyCreation = null; + ObjectStats response = api.copyObject(repository, branch, destPath, objectCopyCreation) + .execute(); + // TODO: test validations + } + + /** + * delete object. Missing objects will not return a NotFound error. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteObjectTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + api.deleteObject(repository, branch, path) + .execute(); + // TODO: test validations + } + + /** + * delete objects. Missing objects will not return a NotFound error. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteObjectsTest() throws ApiException { + String repository = null; + String branch = null; + PathList pathList = null; + ObjectErrorList response = api.deleteObjects(repository, branch, pathList) + .execute(); + // TODO: test validations + } + + /** + * get object content + * + * @throws ApiException if the Api call fails + */ + @Test + public void getObjectTest() throws ApiException { + String repository = null; + String ref = null; + String path = null; + String range = null; + Boolean presign = null; + File response = api.getObject(repository, ref, path) + .range(range) + .presign(presign) + .execute(); + // TODO: test validations + } + + /** + * get object properties on underlying storage + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUnderlyingPropertiesTest() throws ApiException { + String repository = null; + String ref = null; + String path = null; + UnderlyingObjectProperties response = api.getUnderlyingProperties(repository, ref, path) + .execute(); + // TODO: test validations + } + + /** + * check if object exists + * + * @throws ApiException if the Api call fails + */ + @Test + public void headObjectTest() throws ApiException { + String repository = null; + String ref = null; + String path = null; + String range = null; + api.headObject(repository, ref, path) + .range(range) + .execute(); + // TODO: test validations + } + + /** + * list objects under a given prefix + * + * @throws ApiException if the Api call fails + */ + @Test + public void listObjectsTest() throws ApiException { + String repository = null; + String ref = null; + Boolean userMetadata = null; + Boolean presign = null; + String after = null; + Integer amount = null; + String delimiter = null; + String prefix = null; + ObjectStatsList response = api.listObjects(repository, ref) + .userMetadata(userMetadata) + .presign(presign) + .after(after) + .amount(amount) + .delimiter(delimiter) + .prefix(prefix) + .execute(); + // TODO: test validations + } + + /** + * stage an object's metadata for the given branch + * + * @throws ApiException if the Api call fails + */ + @Test + public void stageObjectTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + ObjectStageCreation objectStageCreation = null; + ObjectStats response = api.stageObject(repository, branch, path, objectStageCreation) + .execute(); + // TODO: test validations + } + + /** + * get object metadata + * + * @throws ApiException if the Api call fails + */ + @Test + public void statObjectTest() throws ApiException { + String repository = null; + String ref = null; + String path = null; + Boolean userMetadata = null; + Boolean presign = null; + ObjectStats response = api.statObject(repository, ref, path) + .userMetadata(userMetadata) + .presign(presign) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void uploadObjectTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + String storageClass = null; + String ifNoneMatch = null; + File content = null; + ObjectStats response = api.uploadObject(repository, branch, path) + .storageClass(storageClass) + .ifNoneMatch(ifNoneMatch) + .content(content) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/RefsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/RefsApiTest.java new file mode 100644 index 00000000000..d483f6ec2c3 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/RefsApiTest.java @@ -0,0 +1,150 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.CommitList; +import io.lakefs.clients.sdk.model.DiffList; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.FindMergeBaseResult; +import io.lakefs.clients.sdk.model.Merge; +import io.lakefs.clients.sdk.model.MergeResult; +import io.lakefs.clients.sdk.model.RefsDump; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for RefsApi + */ +@Disabled +public class RefsApiTest { + + private final RefsApi api = new RefsApi(); + + /** + * diff references + * + * @throws ApiException if the Api call fails + */ + @Test + public void diffRefsTest() throws ApiException { + String repository = null; + String leftRef = null; + String rightRef = null; + String after = null; + Integer amount = null; + String prefix = null; + String delimiter = null; + String type = null; + DiffList response = api.diffRefs(repository, leftRef, rightRef) + .after(after) + .amount(amount) + .prefix(prefix) + .delimiter(delimiter) + .type(type) + .execute(); + // TODO: test validations + } + + /** + * Dump repository refs (tags, commits, branches) to object store + * + * @throws ApiException if the Api call fails + */ + @Test + public void dumpRefsTest() throws ApiException { + String repository = null; + RefsDump response = api.dumpRefs(repository) + .execute(); + // TODO: test validations + } + + /** + * find the merge base for 2 references + * + * @throws ApiException if the Api call fails + */ + @Test + public void findMergeBaseTest() throws ApiException { + String repository = null; + String sourceRef = null; + String destinationBranch = null; + FindMergeBaseResult response = api.findMergeBase(repository, sourceRef, destinationBranch) + .execute(); + // TODO: test validations + } + + /** + * get commit log from ref. If both objects and prefixes are empty, return all commits. + * + * @throws ApiException if the Api call fails + */ + @Test + public void logCommitsTest() throws ApiException { + String repository = null; + String ref = null; + String after = null; + Integer amount = null; + List objects = null; + List prefixes = null; + Boolean limit = null; + Boolean firstParent = null; + CommitList response = api.logCommits(repository, ref) + .after(after) + .amount(amount) + .objects(objects) + .prefixes(prefixes) + .limit(limit) + .firstParent(firstParent) + .execute(); + // TODO: test validations + } + + /** + * merge references + * + * @throws ApiException if the Api call fails + */ + @Test + public void mergeIntoBranchTest() throws ApiException { + String repository = null; + String sourceRef = null; + String destinationBranch = null; + Merge merge = null; + MergeResult response = api.mergeIntoBranch(repository, sourceRef, destinationBranch) + .merge(merge) + .execute(); + // TODO: test validations + } + + /** + * Restore repository refs (tags, commits, branches) from object store + * + * @throws ApiException if the Api call fails + */ + @Test + public void restoreRefsTest() throws ApiException { + String repository = null; + RefsDump refsDump = null; + api.restoreRefs(repository, refsDump) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/RepositoriesApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/RepositoriesApiTest.java new file mode 100644 index 00000000000..d0847a2845e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/RepositoriesApiTest.java @@ -0,0 +1,148 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.BranchProtectionRule; +import io.lakefs.clients.sdk.model.DeleteBranchProtectionRuleRequest; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Repository; +import io.lakefs.clients.sdk.model.RepositoryCreation; +import io.lakefs.clients.sdk.model.RepositoryList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for RepositoriesApi + */ +@Disabled +public class RepositoriesApiTest { + + private final RepositoriesApi api = new RepositoriesApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void createBranchProtectionRuleTest() throws ApiException { + String repository = null; + BranchProtectionRule branchProtectionRule = null; + api.createBranchProtectionRule(repository, branchProtectionRule) + .execute(); + // TODO: test validations + } + + /** + * create repository + * + * @throws ApiException if the Api call fails + */ + @Test + public void createRepositoryTest() throws ApiException { + RepositoryCreation repositoryCreation = null; + Boolean bare = null; + Repository response = api.createRepository(repositoryCreation) + .bare(bare) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void deleteBranchProtectionRuleTest() throws ApiException { + String repository = null; + DeleteBranchProtectionRuleRequest deleteBranchProtectionRuleRequest = null; + api.deleteBranchProtectionRule(repository, deleteBranchProtectionRuleRequest) + .execute(); + // TODO: test validations + } + + /** + * delete repository + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteRepositoryTest() throws ApiException { + String repository = null; + api.deleteRepository(repository) + .execute(); + // TODO: test validations + } + + /** + * get branch protection rules + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBranchProtectionRulesTest() throws ApiException { + String repository = null; + List response = api.getBranchProtectionRules(repository) + .execute(); + // TODO: test validations + } + + /** + * get repository + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRepositoryTest() throws ApiException { + String repository = null; + Repository response = api.getRepository(repository) + .execute(); + // TODO: test validations + } + + /** + * get repository metadata + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRepositoryMetadataTest() throws ApiException { + String repository = null; + Map response = api.getRepositoryMetadata(repository) + .execute(); + // TODO: test validations + } + + /** + * list repositories + * + * @throws ApiException if the Api call fails + */ + @Test + public void listRepositoriesTest() throws ApiException { + String prefix = null; + String after = null; + Integer amount = null; + RepositoryList response = api.listRepositories() + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/RetentionApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/RetentionApiTest.java new file mode 100644 index 00000000000..9506bae376a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/RetentionApiTest.java @@ -0,0 +1,100 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.GarbageCollectionPrepareResponse; +import io.lakefs.clients.sdk.model.GarbageCollectionRules; +import io.lakefs.clients.sdk.model.PrepareGCUncommittedRequest; +import io.lakefs.clients.sdk.model.PrepareGCUncommittedResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for RetentionApi + */ +@Disabled +public class RetentionApiTest { + + private final RetentionApi api = new RetentionApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void deleteGarbageCollectionRulesTest() throws ApiException { + String repository = null; + api.deleteGarbageCollectionRules(repository) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getGarbageCollectionRulesTest() throws ApiException { + String repository = null; + GarbageCollectionRules response = api.getGarbageCollectionRules(repository) + .execute(); + // TODO: test validations + } + + /** + * save lists of active commits for garbage collection + * + * @throws ApiException if the Api call fails + */ + @Test + public void prepareGarbageCollectionCommitsTest() throws ApiException { + String repository = null; + GarbageCollectionPrepareResponse response = api.prepareGarbageCollectionCommits(repository) + .execute(); + // TODO: test validations + } + + /** + * save repository uncommitted metadata for garbage collection + * + * @throws ApiException if the Api call fails + */ + @Test + public void prepareGarbageCollectionUncommittedTest() throws ApiException { + String repository = null; + PrepareGCUncommittedRequest prepareGCUncommittedRequest = null; + PrepareGCUncommittedResponse response = api.prepareGarbageCollectionUncommitted(repository) + .prepareGCUncommittedRequest(prepareGCUncommittedRequest) + .execute(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void setGarbageCollectionRulesTest() throws ApiException { + String repository = null; + GarbageCollectionRules garbageCollectionRules = null; + api.setGarbageCollectionRules(repository, garbageCollectionRules) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/StagingApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/StagingApiTest.java new file mode 100644 index 00000000000..3568a47cf92 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/StagingApiTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.StagingLocation; +import io.lakefs.clients.sdk.model.StagingMetadata; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StagingApi + */ +@Disabled +public class StagingApiTest { + + private final StagingApi api = new StagingApi(); + + /** + * get a physical address and a return token to write object to underlying storage + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPhysicalAddressTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + Boolean presign = null; + StagingLocation response = api.getPhysicalAddress(repository, branch, path) + .presign(presign) + .execute(); + // TODO: test validations + } + + /** + * associate staging on this physical address with a path + * + * If the supplied token matches the current staging token, associate the object as the physical address with the supplied path. Otherwise, if staging has been committed and the token has expired, return a conflict and hint where to place the object to try again. Caller should copy the object to the new physical address and PUT again with the new staging token. (No need to back off, this is due to losing the race against a concurrent commit operation.) + * + * @throws ApiException if the Api call fails + */ + @Test + public void linkPhysicalAddressTest() throws ApiException { + String repository = null; + String branch = null; + String path = null; + StagingMetadata stagingMetadata = null; + ObjectStats response = api.linkPhysicalAddress(repository, branch, path, stagingMetadata) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/TagsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/TagsApiTest.java new file mode 100644 index 00000000000..a02a6e515a2 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/TagsApiTest.java @@ -0,0 +1,98 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.Ref; +import io.lakefs.clients.sdk.model.RefList; +import io.lakefs.clients.sdk.model.TagCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TagsApi + */ +@Disabled +public class TagsApiTest { + + private final TagsApi api = new TagsApi(); + + /** + * create tag + * + * @throws ApiException if the Api call fails + */ + @Test + public void createTagTest() throws ApiException { + String repository = null; + TagCreation tagCreation = null; + Ref response = api.createTag(repository, tagCreation) + .execute(); + // TODO: test validations + } + + /** + * delete tag + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteTagTest() throws ApiException { + String repository = null; + String tag = null; + api.deleteTag(repository, tag) + .execute(); + // TODO: test validations + } + + /** + * get tag + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTagTest() throws ApiException { + String repository = null; + String tag = null; + Ref response = api.getTag(repository, tag) + .execute(); + // TODO: test validations + } + + /** + * list tags + * + * @throws ApiException if the Api call fails + */ + @Test + public void listTagsTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + RefList response = api.listTags(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ACLTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ACLTest.java new file mode 100644 index 00000000000..c96af62093c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ACLTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ACL + */ +public class ACLTest { + private final ACL model = new ACL(); + + /** + * Model tests for ACL + */ + @Test + public void testACL() { + // TODO: test ACL + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/AccessKeyCredentialsTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AccessKeyCredentialsTest.java new file mode 100644 index 00000000000..1138767f69b --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AccessKeyCredentialsTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AccessKeyCredentials + */ +public class AccessKeyCredentialsTest { + private final AccessKeyCredentials model = new AccessKeyCredentials(); + + /** + * Model tests for AccessKeyCredentials + */ + @Test + public void testAccessKeyCredentials() { + // TODO: test AccessKeyCredentials + } + + /** + * Test the property 'accessKeyId' + */ + @Test + public void accessKeyIdTest() { + // TODO: test accessKeyId + } + + /** + * Test the property 'secretAccessKey' + */ + @Test + public void secretAccessKeyTest() { + // TODO: test secretAccessKey + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunListTest.java new file mode 100644 index 00000000000..0ca429d574f --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.ActionRun; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ActionRunList + */ +public class ActionRunListTest { + private final ActionRunList model = new ActionRunList(); + + /** + * Model tests for ActionRunList + */ + @Test + public void testActionRunList() { + // TODO: test ActionRunList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunTest.java new file mode 100644 index 00000000000..9d83f522361 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ActionRunTest.java @@ -0,0 +1,97 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ActionRun + */ +public class ActionRunTest { + private final ActionRun model = new ActionRun(); + + /** + * Model tests for ActionRun + */ + @Test + public void testActionRun() { + // TODO: test ActionRun + } + + /** + * Test the property 'runId' + */ + @Test + public void runIdTest() { + // TODO: test runId + } + + /** + * Test the property 'branch' + */ + @Test + public void branchTest() { + // TODO: test branch + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'endTime' + */ + @Test + public void endTimeTest() { + // TODO: test endTime + } + + /** + * Test the property 'eventType' + */ + @Test + public void eventTypeTest() { + // TODO: test eventType + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'commitId' + */ + @Test + public void commitIdTest() { + // TODO: test commitId + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthCapabilitiesTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthCapabilitiesTest.java new file mode 100644 index 00000000000..4f3bf593dfe --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthCapabilitiesTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AuthCapabilities + */ +public class AuthCapabilitiesTest { + private final AuthCapabilities model = new AuthCapabilities(); + + /** + * Model tests for AuthCapabilities + */ + @Test + public void testAuthCapabilities() { + // TODO: test AuthCapabilities + } + + /** + * Test the property 'inviteUser' + */ + @Test + public void inviteUserTest() { + // TODO: test inviteUser + } + + /** + * Test the property 'forgotPassword' + */ + @Test + public void forgotPasswordTest() { + // TODO: test forgotPassword + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthenticationTokenTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthenticationTokenTest.java new file mode 100644 index 00000000000..47e6d3dd159 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AuthenticationTokenTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AuthenticationToken + */ +public class AuthenticationTokenTest { + private final AuthenticationToken model = new AuthenticationToken(); + + /** + * Model tests for AuthenticationToken + */ + @Test + public void testAuthenticationToken() { + // TODO: test AuthenticationToken + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + + /** + * Test the property 'tokenExpiration' + */ + @Test + public void tokenExpirationTest() { + // TODO: test tokenExpiration + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchCreationTest.java new file mode 100644 index 00000000000..e3fdd7dca0f --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BranchCreation + */ +public class BranchCreationTest { + private final BranchCreation model = new BranchCreation(); + + /** + * Model tests for BranchCreation + */ + @Test + public void testBranchCreation() { + // TODO: test BranchCreation + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'source' + */ + @Test + public void sourceTest() { + // TODO: test source + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchProtectionRuleTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchProtectionRuleTest.java new file mode 100644 index 00000000000..72c530e33ba --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/BranchProtectionRuleTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BranchProtectionRule + */ +public class BranchProtectionRuleTest { + private final BranchProtectionRule model = new BranchProtectionRule(); + + /** + * Model tests for BranchProtectionRule + */ + @Test + public void testBranchProtectionRule() { + // TODO: test BranchProtectionRule + } + + /** + * Test the property 'pattern' + */ + @Test + public void patternTest() { + // TODO: test pattern + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CherryPickCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CherryPickCreationTest.java new file mode 100644 index 00000000000..2dfac09acf9 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CherryPickCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CherryPickCreation + */ +public class CherryPickCreationTest { + private final CherryPickCreation model = new CherryPickCreation(); + + /** + * Model tests for CherryPickCreation + */ + @Test + public void testCherryPickCreation() { + // TODO: test CherryPickCreation + } + + /** + * Test the property 'ref' + */ + @Test + public void refTest() { + // TODO: test ref + } + + /** + * Test the property 'parentNumber' + */ + @Test + public void parentNumberTest() { + // TODO: test parentNumber + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommPrefsInputTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommPrefsInputTest.java new file mode 100644 index 00000000000..750ae42b582 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommPrefsInputTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommPrefsInput + */ +public class CommPrefsInputTest { + private final CommPrefsInput model = new CommPrefsInput(); + + /** + * Model tests for CommPrefsInput + */ + @Test + public void testCommPrefsInput() { + // TODO: test CommPrefsInput + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'featureUpdates' + */ + @Test + public void featureUpdatesTest() { + // TODO: test featureUpdates + } + + /** + * Test the property 'securityUpdates' + */ + @Test + public void securityUpdatesTest() { + // TODO: test securityUpdates + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitCreationTest.java new file mode 100644 index 00000000000..a9932356f45 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitCreationTest.java @@ -0,0 +1,66 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommitCreation + */ +public class CommitCreationTest { + private final CommitCreation model = new CommitCreation(); + + /** + * Model tests for CommitCreation + */ + @Test + public void testCommitCreation() { + // TODO: test CommitCreation + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitListTest.java new file mode 100644 index 00000000000..69a25469c4c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommitList + */ +public class CommitListTest { + private final CommitList model = new CommitList(); + + /** + * Model tests for CommitList + */ + @Test + public void testCommitList() { + // TODO: test CommitList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitTest.java new file mode 100644 index 00000000000..a3231b811d7 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitTest.java @@ -0,0 +1,100 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Commit + */ +public class CommitTest { + private final Commit model = new Commit(); + + /** + * Model tests for Commit + */ + @Test + public void testCommit() { + // TODO: test Commit + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'parents' + */ + @Test + public void parentsTest() { + // TODO: test parents + } + + /** + * Test the property 'committer' + */ + @Test + public void committerTest() { + // TODO: test committer + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + + /** + * Test the property 'metaRangeId' + */ + @Test + public void metaRangeIdTest() { + // TODO: test metaRangeId + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsListTest.java new file mode 100644 index 00000000000..691615bb998 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Credentials; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CredentialsList + */ +public class CredentialsListTest { + private final CredentialsList model = new CredentialsList(); + + /** + * Model tests for CredentialsList + */ + @Test + public void testCredentialsList() { + // TODO: test CredentialsList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsTest.java new file mode 100644 index 00000000000..9c49cc9d348 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Credentials + */ +public class CredentialsTest { + private final Credentials model = new Credentials(); + + /** + * Model tests for Credentials + */ + @Test + public void testCredentials() { + // TODO: test Credentials + } + + /** + * Test the property 'accessKeyId' + */ + @Test + public void accessKeyIdTest() { + // TODO: test accessKeyId + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsWithSecretTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsWithSecretTest.java new file mode 100644 index 00000000000..898c8459377 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CredentialsWithSecretTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CredentialsWithSecret + */ +public class CredentialsWithSecretTest { + private final CredentialsWithSecret model = new CredentialsWithSecret(); + + /** + * Model tests for CredentialsWithSecret + */ + @Test + public void testCredentialsWithSecret() { + // TODO: test CredentialsWithSecret + } + + /** + * Test the property 'accessKeyId' + */ + @Test + public void accessKeyIdTest() { + // TODO: test accessKeyId + } + + /** + * Test the property 'secretAccessKey' + */ + @Test + public void secretAccessKeyTest() { + // TODO: test secretAccessKey + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CurrentUserTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CurrentUserTest.java new file mode 100644 index 00000000000..c945b21756e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CurrentUserTest.java @@ -0,0 +1,49 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.User; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CurrentUser + */ +public class CurrentUserTest { + private final CurrentUser model = new CurrentUser(); + + /** + * Model tests for CurrentUser + */ + @Test + public void testCurrentUser() { + // TODO: test CurrentUser + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequestTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequestTest.java new file mode 100644 index 00000000000..18577e45bd4 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DeleteBranchProtectionRuleRequestTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeleteBranchProtectionRuleRequest + */ +public class DeleteBranchProtectionRuleRequestTest { + private final DeleteBranchProtectionRuleRequest model = new DeleteBranchProtectionRuleRequest(); + + /** + * Model tests for DeleteBranchProtectionRuleRequest + */ + @Test + public void testDeleteBranchProtectionRuleRequest() { + // TODO: test DeleteBranchProtectionRuleRequest + } + + /** + * Test the property 'pattern' + */ + @Test + public void patternTest() { + // TODO: test pattern + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffListTest.java new file mode 100644 index 00000000000..481d4dcc19e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Diff; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DiffList + */ +public class DiffListTest { + private final DiffList model = new DiffList(); + + /** + * Model tests for DiffList + */ + @Test + public void testDiffList() { + // TODO: test DiffList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffPropertiesTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffPropertiesTest.java new file mode 100644 index 00000000000..d2556f20fbe --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffPropertiesTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DiffProperties + */ +public class DiffPropertiesTest { + private final DiffProperties model = new DiffProperties(); + + /** + * Model tests for DiffProperties + */ + @Test + public void testDiffProperties() { + // TODO: test DiffProperties + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffTest.java new file mode 100644 index 00000000000..1ef4af624ba --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/DiffTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Diff + */ +public class DiffTest { + private final Diff model = new Diff(); + + /** + * Model tests for Diff + */ + @Test + public void testDiff() { + // TODO: test Diff + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + + /** + * Test the property 'pathType' + */ + @Test + public void pathTypeTest() { + // TODO: test pathType + } + + /** + * Test the property 'sizeBytes' + */ + @Test + public void sizeBytesTest() { + // TODO: test sizeBytes + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorNoACLTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorNoACLTest.java new file mode 100644 index 00000000000..76b2e2daf17 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorNoACLTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ErrorNoACL + */ +public class ErrorNoACLTest { + private final ErrorNoACL model = new ErrorNoACL(); + + /** + * Model tests for ErrorNoACL + */ + @Test + public void testErrorNoACL() { + // TODO: test ErrorNoACL + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'noAcl' + */ + @Test + public void noAclTest() { + // TODO: test noAcl + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorTest.java new file mode 100644 index 00000000000..7edfb688820 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ErrorTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Error + */ +public class ErrorTest { + private final Error model = new Error(); + + /** + * Model tests for Error + */ + @Test + public void testError() { + // TODO: test Error + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/FindMergeBaseResultTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/FindMergeBaseResultTest.java new file mode 100644 index 00000000000..9c147a428f2 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/FindMergeBaseResultTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FindMergeBaseResult + */ +public class FindMergeBaseResultTest { + private final FindMergeBaseResult model = new FindMergeBaseResult(); + + /** + * Model tests for FindMergeBaseResult + */ + @Test + public void testFindMergeBaseResult() { + // TODO: test FindMergeBaseResult + } + + /** + * Test the property 'sourceCommitId' + */ + @Test + public void sourceCommitIdTest() { + // TODO: test sourceCommitId + } + + /** + * Test the property 'destinationCommitId' + */ + @Test + public void destinationCommitIdTest() { + // TODO: test destinationCommitId + } + + /** + * Test the property 'baseCommitId' + */ + @Test + public void baseCommitIdTest() { + // TODO: test baseCommitId + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionConfigTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionConfigTest.java new file mode 100644 index 00000000000..d92ca234647 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionConfigTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GarbageCollectionConfig + */ +public class GarbageCollectionConfigTest { + private final GarbageCollectionConfig model = new GarbageCollectionConfig(); + + /** + * Model tests for GarbageCollectionConfig + */ + @Test + public void testGarbageCollectionConfig() { + // TODO: test GarbageCollectionConfig + } + + /** + * Test the property 'gracePeriod' + */ + @Test + public void gracePeriodTest() { + // TODO: test gracePeriod + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponseTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponseTest.java new file mode 100644 index 00000000000..52ce533a175 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponseTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GarbageCollectionPrepareResponse + */ +public class GarbageCollectionPrepareResponseTest { + private final GarbageCollectionPrepareResponse model = new GarbageCollectionPrepareResponse(); + + /** + * Model tests for GarbageCollectionPrepareResponse + */ + @Test + public void testGarbageCollectionPrepareResponse() { + // TODO: test GarbageCollectionPrepareResponse + } + + /** + * Test the property 'runId' + */ + @Test + public void runIdTest() { + // TODO: test runId + } + + /** + * Test the property 'gcCommitsLocation' + */ + @Test + public void gcCommitsLocationTest() { + // TODO: test gcCommitsLocation + } + + /** + * Test the property 'gcAddressesLocation' + */ + @Test + public void gcAddressesLocationTest() { + // TODO: test gcAddressesLocation + } + + /** + * Test the property 'gcCommitsPresignedUrl' + */ + @Test + public void gcCommitsPresignedUrlTest() { + // TODO: test gcCommitsPresignedUrl + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRuleTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRuleTest.java new file mode 100644 index 00000000000..b1d74f89a7d --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRuleTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GarbageCollectionRule + */ +public class GarbageCollectionRuleTest { + private final GarbageCollectionRule model = new GarbageCollectionRule(); + + /** + * Model tests for GarbageCollectionRule + */ + @Test + public void testGarbageCollectionRule() { + // TODO: test GarbageCollectionRule + } + + /** + * Test the property 'branchId' + */ + @Test + public void branchIdTest() { + // TODO: test branchId + } + + /** + * Test the property 'retentionDays' + */ + @Test + public void retentionDaysTest() { + // TODO: test retentionDays + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRulesTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRulesTest.java new file mode 100644 index 00000000000..db21a23a58b --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GarbageCollectionRulesTest.java @@ -0,0 +1,59 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.GarbageCollectionRule; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GarbageCollectionRules + */ +public class GarbageCollectionRulesTest { + private final GarbageCollectionRules model = new GarbageCollectionRules(); + + /** + * Model tests for GarbageCollectionRules + */ + @Test + public void testGarbageCollectionRules() { + // TODO: test GarbageCollectionRules + } + + /** + * Test the property 'defaultRetentionDays' + */ + @Test + public void defaultRetentionDaysTest() { + // TODO: test defaultRetentionDays + } + + /** + * Test the property 'branches' + */ + @Test + public void branchesTest() { + // TODO: test branches + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupCreationTest.java new file mode 100644 index 00000000000..6e1f3f4943c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupCreationTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupCreation + */ +public class GroupCreationTest { + private final GroupCreation model = new GroupCreation(); + + /** + * Model tests for GroupCreation + */ + @Test + public void testGroupCreation() { + // TODO: test GroupCreation + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupListTest.java new file mode 100644 index 00000000000..cf4d032fe24 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Group; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupList + */ +public class GroupListTest { + private final GroupList model = new GroupList(); + + /** + * Model tests for GroupList + */ + @Test + public void testGroupList() { + // TODO: test GroupList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupTest.java new file mode 100644 index 00000000000..273fe1dd54e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/GroupTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Group + */ +public class GroupTest { + private final Group model = new Group(); + + /** + * Model tests for Group + */ + @Test + public void testGroup() { + // TODO: test Group + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunListTest.java new file mode 100644 index 00000000000..41078d56464 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.HookRun; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HookRunList + */ +public class HookRunListTest { + private final HookRunList model = new HookRunList(); + + /** + * Model tests for HookRunList + */ + @Test + public void testHookRunList() { + // TODO: test HookRunList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunTest.java new file mode 100644 index 00000000000..11a6b3a4d63 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/HookRunTest.java @@ -0,0 +1,89 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HookRun + */ +public class HookRunTest { + private final HookRun model = new HookRun(); + + /** + * Model tests for HookRun + */ + @Test + public void testHookRun() { + // TODO: test HookRun + } + + /** + * Test the property 'hookRunId' + */ + @Test + public void hookRunIdTest() { + // TODO: test hookRunId + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + + /** + * Test the property 'hookId' + */ + @Test + public void hookIdTest() { + // TODO: test hookId + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'endTime' + */ + @Test + public void endTimeTest() { + // TODO: test endTime + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationResponseTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationResponseTest.java new file mode 100644 index 00000000000..86212b38ff8 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationResponseTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ImportCreationResponse + */ +public class ImportCreationResponseTest { + private final ImportCreationResponse model = new ImportCreationResponse(); + + /** + * Model tests for ImportCreationResponse + */ + @Test + public void testImportCreationResponse() { + // TODO: test ImportCreationResponse + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationTest.java new file mode 100644 index 00000000000..40deeb7649a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportCreationTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.CommitCreation; +import io.lakefs.clients.sdk.model.ImportLocation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ImportCreation + */ +public class ImportCreationTest { + private final ImportCreation model = new ImportCreation(); + + /** + * Model tests for ImportCreation + */ + @Test + public void testImportCreation() { + // TODO: test ImportCreation + } + + /** + * Test the property 'paths' + */ + @Test + public void pathsTest() { + // TODO: test paths + } + + /** + * Test the property 'commit' + */ + @Test + public void commitTest() { + // TODO: test commit + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportLocationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportLocationTest.java new file mode 100644 index 00000000000..d7bb3600570 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportLocationTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ImportLocation + */ +public class ImportLocationTest { + private final ImportLocation model = new ImportLocation(); + + /** + * Model tests for ImportLocation + */ + @Test + public void testImportLocation() { + // TODO: test ImportLocation + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportStatusTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportStatusTest.java new file mode 100644 index 00000000000..6497be6a9e4 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ImportStatusTest.java @@ -0,0 +1,91 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Commit; +import io.lakefs.clients.sdk.model.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ImportStatus + */ +public class ImportStatusTest { + private final ImportStatus model = new ImportStatus(); + + /** + * Model tests for ImportStatus + */ + @Test + public void testImportStatus() { + // TODO: test ImportStatus + } + + /** + * Test the property 'completed' + */ + @Test + public void completedTest() { + // TODO: test completed + } + + /** + * Test the property 'updateTime' + */ + @Test + public void updateTimeTest() { + // TODO: test updateTime + } + + /** + * Test the property 'ingestedObjects' + */ + @Test + public void ingestedObjectsTest() { + // TODO: test ingestedObjects + } + + /** + * Test the property 'metarangeId' + */ + @Test + public void metarangeIdTest() { + // TODO: test metarangeId + } + + /** + * Test the property 'commit' + */ + @Test + public void commitTest() { + // TODO: test commit + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginConfigTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginConfigTest.java new file mode 100644 index 00000000000..8aa19c029bd --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginConfigTest.java @@ -0,0 +1,98 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoginConfig + */ +public class LoginConfigTest { + private final LoginConfig model = new LoginConfig(); + + /** + * Model tests for LoginConfig + */ + @Test + public void testLoginConfig() { + // TODO: test LoginConfig + } + + /** + * Test the property 'RBAC' + */ + @Test + public void RBACTest() { + // TODO: test RBAC + } + + /** + * Test the property 'loginUrl' + */ + @Test + public void loginUrlTest() { + // TODO: test loginUrl + } + + /** + * Test the property 'loginFailedMessage' + */ + @Test + public void loginFailedMessageTest() { + // TODO: test loginFailedMessage + } + + /** + * Test the property 'fallbackLoginUrl' + */ + @Test + public void fallbackLoginUrlTest() { + // TODO: test fallbackLoginUrl + } + + /** + * Test the property 'fallbackLoginLabel' + */ + @Test + public void fallbackLoginLabelTest() { + // TODO: test fallbackLoginLabel + } + + /** + * Test the property 'loginCookieNames' + */ + @Test + public void loginCookieNamesTest() { + // TODO: test loginCookieNames + } + + /** + * Test the property 'logoutUrl' + */ + @Test + public void logoutUrlTest() { + // TODO: test logoutUrl + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginInformationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginInformationTest.java new file mode 100644 index 00000000000..1c5da58cbcb --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/LoginInformationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoginInformation + */ +public class LoginInformationTest { + private final LoginInformation model = new LoginInformation(); + + /** + * Model tests for LoginInformation + */ + @Test + public void testLoginInformation() { + // TODO: test LoginInformation + } + + /** + * Test the property 'accessKeyId' + */ + @Test + public void accessKeyIdTest() { + // TODO: test accessKeyId + } + + /** + * Test the property 'secretAccessKey' + */ + @Test + public void secretAccessKeyTest() { + // TODO: test secretAccessKey + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeResultTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeResultTest.java new file mode 100644 index 00000000000..4ef743efbea --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeResultTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MergeResult + */ +public class MergeResultTest { + private final MergeResult model = new MergeResult(); + + /** + * Model tests for MergeResult + */ + @Test + public void testMergeResult() { + // TODO: test MergeResult + } + + /** + * Test the property 'reference' + */ + @Test + public void referenceTest() { + // TODO: test reference + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeTest.java new file mode 100644 index 00000000000..484b28e314c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeTest.java @@ -0,0 +1,66 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Merge + */ +public class MergeTest { + private final Merge model = new Merge(); + + /** + * Model tests for Merge + */ + @Test + public void testMerge() { + // TODO: test Merge + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'strategy' + */ + @Test + public void strategyTest() { + // TODO: test strategy + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponseTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponseTest.java new file mode 100644 index 00000000000..b1ed1220e8e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponseTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MetaRangeCreationResponse + */ +public class MetaRangeCreationResponseTest { + private final MetaRangeCreationResponse model = new MetaRangeCreationResponse(); + + /** + * Model tests for MetaRangeCreationResponse + */ + @Test + public void testMetaRangeCreationResponse() { + // TODO: test MetaRangeCreationResponse + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationTest.java new file mode 100644 index 00000000000..dc3c91fe18f --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MetaRangeCreationTest.java @@ -0,0 +1,51 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.RangeMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MetaRangeCreation + */ +public class MetaRangeCreationTest { + private final MetaRangeCreation model = new MetaRangeCreation(); + + /** + * Model tests for MetaRangeCreation + */ + @Test + public void testMetaRangeCreation() { + // TODO: test MetaRangeCreation + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/OTFDiffsTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OTFDiffsTest.java new file mode 100644 index 00000000000..3bc0548b546 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OTFDiffsTest.java @@ -0,0 +1,51 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.DiffProperties; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OTFDiffs + */ +public class OTFDiffsTest { + private final OTFDiffs model = new OTFDiffs(); + + /** + * Model tests for OTFDiffs + */ + @Test + public void testOTFDiffs() { + // TODO: test OTFDiffs + } + + /** + * Test the property 'diffs' + */ + @Test + public void diffsTest() { + // TODO: test diffs + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectCopyCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectCopyCreationTest.java new file mode 100644 index 00000000000..7cdbd19e7e3 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectCopyCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectCopyCreation + */ +public class ObjectCopyCreationTest { + private final ObjectCopyCreation model = new ObjectCopyCreation(); + + /** + * Model tests for ObjectCopyCreation + */ + @Test + public void testObjectCopyCreation() { + // TODO: test ObjectCopyCreation + } + + /** + * Test the property 'srcPath' + */ + @Test + public void srcPathTest() { + // TODO: test srcPath + } + + /** + * Test the property 'srcRef' + */ + @Test + public void srcRefTest() { + // TODO: test srcRef + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorListTest.java new file mode 100644 index 00000000000..b3b87927625 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorListTest.java @@ -0,0 +1,51 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.ObjectError; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectErrorList + */ +public class ObjectErrorListTest { + private final ObjectErrorList model = new ObjectErrorList(); + + /** + * Model tests for ObjectErrorList + */ + @Test + public void testObjectErrorList() { + // TODO: test ObjectErrorList + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorTest.java new file mode 100644 index 00000000000..17f6a9b94ef --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectErrorTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectError + */ +public class ObjectErrorTest { + private final ObjectError model = new ObjectError(); + + /** + * Model tests for ObjectError + */ + @Test + public void testObjectError() { + // TODO: test ObjectError + } + + /** + * Test the property 'statusCode' + */ + @Test + public void statusCodeTest() { + // TODO: test statusCode + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStageCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStageCreationTest.java new file mode 100644 index 00000000000..cdcdf7013d8 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStageCreationTest.java @@ -0,0 +1,90 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectStageCreation + */ +public class ObjectStageCreationTest { + private final ObjectStageCreation model = new ObjectStageCreation(); + + /** + * Model tests for ObjectStageCreation + */ + @Test + public void testObjectStageCreation() { + // TODO: test ObjectStageCreation + } + + /** + * Test the property 'physicalAddress' + */ + @Test + public void physicalAddressTest() { + // TODO: test physicalAddress + } + + /** + * Test the property 'checksum' + */ + @Test + public void checksumTest() { + // TODO: test checksum + } + + /** + * Test the property 'sizeBytes' + */ + @Test + public void sizeBytesTest() { + // TODO: test sizeBytes + } + + /** + * Test the property 'mtime' + */ + @Test + public void mtimeTest() { + // TODO: test mtime + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'contentType' + */ + @Test + public void contentTypeTest() { + // TODO: test contentType + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsListTest.java new file mode 100644 index 00000000000..10fbc8a689d --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.ObjectStats; +import io.lakefs.clients.sdk.model.Pagination; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectStatsList + */ +public class ObjectStatsListTest { + private final ObjectStatsList model = new ObjectStatsList(); + + /** + * Model tests for ObjectStatsList + */ + @Test + public void testObjectStatsList() { + // TODO: test ObjectStatsList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsTest.java new file mode 100644 index 00000000000..c0ec3a82d23 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ObjectStatsTest.java @@ -0,0 +1,114 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectStats + */ +public class ObjectStatsTest { + private final ObjectStats model = new ObjectStats(); + + /** + * Model tests for ObjectStats + */ + @Test + public void testObjectStats() { + // TODO: test ObjectStats + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + + /** + * Test the property 'pathType' + */ + @Test + public void pathTypeTest() { + // TODO: test pathType + } + + /** + * Test the property 'physicalAddress' + */ + @Test + public void physicalAddressTest() { + // TODO: test physicalAddress + } + + /** + * Test the property 'physicalAddressExpiry' + */ + @Test + public void physicalAddressExpiryTest() { + // TODO: test physicalAddressExpiry + } + + /** + * Test the property 'checksum' + */ + @Test + public void checksumTest() { + // TODO: test checksum + } + + /** + * Test the property 'sizeBytes' + */ + @Test + public void sizeBytesTest() { + // TODO: test sizeBytes + } + + /** + * Test the property 'mtime' + */ + @Test + public void mtimeTest() { + // TODO: test mtime + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'contentType' + */ + @Test + public void contentTypeTest() { + // TODO: test contentType + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffEntryTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffEntryTest.java new file mode 100644 index 00000000000..6448b890a74 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffEntryTest.java @@ -0,0 +1,80 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OtfDiffEntry + */ +public class OtfDiffEntryTest { + private final OtfDiffEntry model = new OtfDiffEntry(); + + /** + * Model tests for OtfDiffEntry + */ + @Test + public void testOtfDiffEntry() { + // TODO: test OtfDiffEntry + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'operation' + */ + @Test + public void operationTest() { + // TODO: test operation + } + + /** + * Test the property 'operationContent' + */ + @Test + public void operationContentTest() { + // TODO: test operationContent + } + + /** + * Test the property 'operationType' + */ + @Test + public void operationTypeTest() { + // TODO: test operationType + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffListTest.java new file mode 100644 index 00000000000..93ac5ac9393 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/OtfDiffListTest.java @@ -0,0 +1,59 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.OtfDiffEntry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OtfDiffList + */ +public class OtfDiffListTest { + private final OtfDiffList model = new OtfDiffList(); + + /** + * Model tests for OtfDiffList + */ + @Test + public void testOtfDiffList() { + // TODO: test OtfDiffList + } + + /** + * Test the property 'diffType' + */ + @Test + public void diffTypeTest() { + // TODO: test diffType + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PaginationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PaginationTest.java new file mode 100644 index 00000000000..e1b20e45330 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PaginationTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pagination + */ +public class PaginationTest { + private final Pagination model = new Pagination(); + + /** + * Model tests for Pagination + */ + @Test + public void testPagination() { + // TODO: test Pagination + } + + /** + * Test the property 'hasMore' + */ + @Test + public void hasMoreTest() { + // TODO: test hasMore + } + + /** + * Test the property 'nextOffset' + */ + @Test + public void nextOffsetTest() { + // TODO: test nextOffset + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + + /** + * Test the property 'maxPerPage' + */ + @Test + public void maxPerPageTest() { + // TODO: test maxPerPage + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PathListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PathListTest.java new file mode 100644 index 00000000000..61ed60296de --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PathListTest.java @@ -0,0 +1,50 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PathList + */ +public class PathListTest { + private final PathList model = new PathList(); + + /** + * Model tests for PathList + */ + @Test + public void testPathList() { + // TODO: test PathList + } + + /** + * Test the property 'paths' + */ + @Test + public void pathsTest() { + // TODO: test paths + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyListTest.java new file mode 100644 index 00000000000..22bfa57c258 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Policy; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PolicyList + */ +public class PolicyListTest { + private final PolicyList model = new PolicyList(); + + /** + * Model tests for PolicyList + */ + @Test + public void testPolicyList() { + // TODO: test PolicyList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyTest.java new file mode 100644 index 00000000000..4ac9d076616 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PolicyTest.java @@ -0,0 +1,67 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Statement; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Policy + */ +public class PolicyTest { + private final Policy model = new Policy(); + + /** + * Model tests for Policy + */ + @Test + public void testPolicy() { + // TODO: test Policy + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + + /** + * Test the property 'statement' + */ + @Test + public void statementTest() { + // TODO: test statement + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequestTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequestTest.java new file mode 100644 index 00000000000..9c1b2d6b898 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequestTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PrepareGCUncommittedRequest + */ +public class PrepareGCUncommittedRequestTest { + private final PrepareGCUncommittedRequest model = new PrepareGCUncommittedRequest(); + + /** + * Model tests for PrepareGCUncommittedRequest + */ + @Test + public void testPrepareGCUncommittedRequest() { + // TODO: test PrepareGCUncommittedRequest + } + + /** + * Test the property 'continuationToken' + */ + @Test + public void continuationTokenTest() { + // TODO: test continuationToken + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponseTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponseTest.java new file mode 100644 index 00000000000..2d098329425 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponseTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PrepareGCUncommittedResponse + */ +public class PrepareGCUncommittedResponseTest { + private final PrepareGCUncommittedResponse model = new PrepareGCUncommittedResponse(); + + /** + * Model tests for PrepareGCUncommittedResponse + */ + @Test + public void testPrepareGCUncommittedResponse() { + // TODO: test PrepareGCUncommittedResponse + } + + /** + * Test the property 'runId' + */ + @Test + public void runIdTest() { + // TODO: test runId + } + + /** + * Test the property 'gcUncommittedLocation' + */ + @Test + public void gcUncommittedLocationTest() { + // TODO: test gcUncommittedLocation + } + + /** + * Test the property 'continuationToken' + */ + @Test + public void continuationTokenTest() { + // TODO: test continuationToken + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RangeMetadataTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RangeMetadataTest.java new file mode 100644 index 00000000000..c7184d07015 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RangeMetadataTest.java @@ -0,0 +1,80 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RangeMetadata + */ +public class RangeMetadataTest { + private final RangeMetadata model = new RangeMetadata(); + + /** + * Model tests for RangeMetadata + */ + @Test + public void testRangeMetadata() { + // TODO: test RangeMetadata + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'minKey' + */ + @Test + public void minKeyTest() { + // TODO: test minKey + } + + /** + * Test the property 'maxKey' + */ + @Test + public void maxKeyTest() { + // TODO: test maxKey + } + + /** + * Test the property 'count' + */ + @Test + public void countTest() { + // TODO: test count + } + + /** + * Test the property 'estimatedSize' + */ + @Test + public void estimatedSizeTest() { + // TODO: test estimatedSize + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefListTest.java new file mode 100644 index 00000000000..bb2b32a325a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Ref; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RefList + */ +public class RefListTest { + private final RefList model = new RefList(); + + /** + * Model tests for RefList + */ + @Test + public void testRefList() { + // TODO: test RefList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefTest.java new file mode 100644 index 00000000000..724b0ffad6a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Ref + */ +public class RefTest { + private final Ref model = new Ref(); + + /** + * Model tests for Ref + */ + @Test + public void testRef() { + // TODO: test Ref + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'commitId' + */ + @Test + public void commitIdTest() { + // TODO: test commitId + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefsDumpTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefsDumpTest.java new file mode 100644 index 00000000000..f4f3162d849 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RefsDumpTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RefsDump + */ +public class RefsDumpTest { + private final RefsDump model = new RefsDump(); + + /** + * Model tests for RefsDump + */ + @Test + public void testRefsDump() { + // TODO: test RefsDump + } + + /** + * Test the property 'commitsMetaRangeId' + */ + @Test + public void commitsMetaRangeIdTest() { + // TODO: test commitsMetaRangeId + } + + /** + * Test the property 'tagsMetaRangeId' + */ + @Test + public void tagsMetaRangeIdTest() { + // TODO: test tagsMetaRangeId + } + + /** + * Test the property 'branchesMetaRangeId' + */ + @Test + public void branchesMetaRangeIdTest() { + // TODO: test branchesMetaRangeId + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java new file mode 100644 index 00000000000..0fa8f5a442f --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RepositoryCreation + */ +public class RepositoryCreationTest { + private final RepositoryCreation model = new RepositoryCreation(); + + /** + * Model tests for RepositoryCreation + */ + @Test + public void testRepositoryCreation() { + // TODO: test RepositoryCreation + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'storageNamespace' + */ + @Test + public void storageNamespaceTest() { + // TODO: test storageNamespace + } + + /** + * Test the property 'defaultBranch' + */ + @Test + public void defaultBranchTest() { + // TODO: test defaultBranch + } + + /** + * Test the property 'sampleData' + */ + @Test + public void sampleDataTest() { + // TODO: test sampleData + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryListTest.java new file mode 100644 index 00000000000..8310123edc5 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.Repository; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RepositoryList + */ +public class RepositoryListTest { + private final RepositoryList model = new RepositoryList(); + + /** + * Model tests for RepositoryList + */ + @Test + public void testRepositoryList() { + // TODO: test RepositoryList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java new file mode 100644 index 00000000000..0ea862be385 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Repository + */ +public class RepositoryTest { + private final Repository model = new Repository(); + + /** + * Model tests for Repository + */ + @Test + public void testRepository() { + // TODO: test Repository + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + + /** + * Test the property 'defaultBranch' + */ + @Test + public void defaultBranchTest() { + // TODO: test defaultBranch + } + + /** + * Test the property 'storageNamespace' + */ + @Test + public void storageNamespaceTest() { + // TODO: test storageNamespace + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/ResetCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ResetCreationTest.java new file mode 100644 index 00000000000..27211256b31 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/ResetCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ResetCreation + */ +public class ResetCreationTest { + private final ResetCreation model = new ResetCreation(); + + /** + * Model tests for ResetCreation + */ + @Test + public void testResetCreation() { + // TODO: test ResetCreation + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RevertCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RevertCreationTest.java new file mode 100644 index 00000000000..5b28763c9c4 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RevertCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RevertCreation + */ +public class RevertCreationTest { + private final RevertCreation model = new RevertCreation(); + + /** + * Model tests for RevertCreation + */ + @Test + public void testRevertCreation() { + // TODO: test RevertCreation + } + + /** + * Test the property 'ref' + */ + @Test + public void refTest() { + // TODO: test ref + } + + /** + * Test the property 'parentNumber' + */ + @Test + public void parentNumberTest() { + // TODO: test parentNumber + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupStateTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupStateTest.java new file mode 100644 index 00000000000..aa198a517c5 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupStateTest.java @@ -0,0 +1,65 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.LoginConfig; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SetupState + */ +public class SetupStateTest { + private final SetupState model = new SetupState(); + + /** + * Model tests for SetupState + */ + @Test + public void testSetupState() { + // TODO: test SetupState + } + + /** + * Test the property 'state' + */ + @Test + public void stateTest() { + // TODO: test state + } + + /** + * Test the property 'commPrefsMissing' + */ + @Test + public void commPrefsMissingTest() { + // TODO: test commPrefsMissing + } + + /** + * Test the property 'loginConfig' + */ + @Test + public void loginConfigTest() { + // TODO: test loginConfig + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupTest.java new file mode 100644 index 00000000000..9b22c240f08 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/SetupTest.java @@ -0,0 +1,57 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.AccessKeyCredentials; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Setup + */ +public class SetupTest { + private final Setup model = new Setup(); + + /** + * Model tests for Setup + */ + @Test + public void testSetup() { + // TODO: test Setup + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingLocationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingLocationTest.java new file mode 100644 index 00000000000..bd21937a12e --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingLocationTest.java @@ -0,0 +1,73 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StagingLocation + */ +public class StagingLocationTest { + private final StagingLocation model = new StagingLocation(); + + /** + * Model tests for StagingLocation + */ + @Test + public void testStagingLocation() { + // TODO: test StagingLocation + } + + /** + * Test the property 'physicalAddress' + */ + @Test + public void physicalAddressTest() { + // TODO: test physicalAddress + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + + /** + * Test the property 'presignedUrl' + */ + @Test + public void presignedUrlTest() { + // TODO: test presignedUrl + } + + /** + * Test the property 'presignedUrlExpiry' + */ + @Test + public void presignedUrlExpiryTest() { + // TODO: test presignedUrlExpiry + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingMetadataTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingMetadataTest.java new file mode 100644 index 00000000000..4088d6fe4b4 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StagingMetadataTest.java @@ -0,0 +1,83 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.StagingLocation; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StagingMetadata + */ +public class StagingMetadataTest { + private final StagingMetadata model = new StagingMetadata(); + + /** + * Model tests for StagingMetadata + */ + @Test + public void testStagingMetadata() { + // TODO: test StagingMetadata + } + + /** + * Test the property 'staging' + */ + @Test + public void stagingTest() { + // TODO: test staging + } + + /** + * Test the property 'checksum' + */ + @Test + public void checksumTest() { + // TODO: test checksum + } + + /** + * Test the property 'sizeBytes' + */ + @Test + public void sizeBytesTest() { + // TODO: test sizeBytes + } + + /** + * Test the property 'userMetadata' + */ + @Test + public void userMetadataTest() { + // TODO: test userMetadata + } + + /** + * Test the property 'contentType' + */ + @Test + public void contentTypeTest() { + // TODO: test contentType + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatementTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatementTest.java new file mode 100644 index 00000000000..0d0dc14f8cd --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatementTest.java @@ -0,0 +1,66 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Statement + */ +public class StatementTest { + private final Statement model = new Statement(); + + /** + * Model tests for Statement + */ + @Test + public void testStatement() { + // TODO: test Statement + } + + /** + * Test the property 'effect' + */ + @Test + public void effectTest() { + // TODO: test effect + } + + /** + * Test the property 'resource' + */ + @Test + public void resourceTest() { + // TODO: test resource + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventTest.java new file mode 100644 index 00000000000..d4d3ebd5095 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StatsEvent + */ +public class StatsEventTest { + private final StatsEvent model = new StatsEvent(); + + /** + * Model tests for StatsEvent + */ + @Test + public void testStatsEvent() { + // TODO: test StatsEvent + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'count' + */ + @Test + public void countTest() { + // TODO: test count + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventsListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventsListTest.java new file mode 100644 index 00000000000..33986a12efe --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StatsEventsListTest.java @@ -0,0 +1,51 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.StatsEvent; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StatsEventsList + */ +public class StatsEventsListTest { + private final StatsEventsList model = new StatsEventsList(); + + /** + * Model tests for StatsEventsList + */ + @Test + public void testStatsEventsList() { + // TODO: test StatsEventsList + } + + /** + * Test the property 'events' + */ + @Test + public void eventsTest() { + // TODO: test events + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageConfigTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageConfigTest.java new file mode 100644 index 00000000000..5785c006b55 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageConfigTest.java @@ -0,0 +1,104 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StorageConfig + */ +public class StorageConfigTest { + private final StorageConfig model = new StorageConfig(); + + /** + * Model tests for StorageConfig + */ + @Test + public void testStorageConfig() { + // TODO: test StorageConfig + } + + /** + * Test the property 'blockstoreType' + */ + @Test + public void blockstoreTypeTest() { + // TODO: test blockstoreType + } + + /** + * Test the property 'blockstoreNamespaceExample' + */ + @Test + public void blockstoreNamespaceExampleTest() { + // TODO: test blockstoreNamespaceExample + } + + /** + * Test the property 'blockstoreNamespaceValidityRegex' + */ + @Test + public void blockstoreNamespaceValidityRegexTest() { + // TODO: test blockstoreNamespaceValidityRegex + } + + /** + * Test the property 'defaultNamespacePrefix' + */ + @Test + public void defaultNamespacePrefixTest() { + // TODO: test defaultNamespacePrefix + } + + /** + * Test the property 'preSignSupport' + */ + @Test + public void preSignSupportTest() { + // TODO: test preSignSupport + } + + /** + * Test the property 'preSignSupportUi' + */ + @Test + public void preSignSupportUiTest() { + // TODO: test preSignSupportUi + } + + /** + * Test the property 'importSupport' + */ + @Test + public void importSupportTest() { + // TODO: test importSupport + } + + /** + * Test the property 'importValidityRegex' + */ + @Test + public void importValidityRegexTest() { + // TODO: test importValidityRegex + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageURITest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageURITest.java new file mode 100644 index 00000000000..871cda0b9ad --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/StorageURITest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StorageURI + */ +public class StorageURITest { + private final StorageURI model = new StorageURI(); + + /** + * Model tests for StorageURI + */ + @Test + public void testStorageURI() { + // TODO: test StorageURI + } + + /** + * Test the property 'location' + */ + @Test + public void locationTest() { + // TODO: test location + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/TagCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/TagCreationTest.java new file mode 100644 index 00000000000..03c7fad100c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/TagCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TagCreation + */ +public class TagCreationTest { + private final TagCreation model = new TagCreation(); + + /** + * Model tests for TagCreation + */ + @Test + public void testTagCreation() { + // TODO: test TagCreation + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'ref' + */ + @Test + public void refTest() { + // TODO: test ref + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/UnderlyingObjectPropertiesTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UnderlyingObjectPropertiesTest.java new file mode 100644 index 00000000000..151a75243a7 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UnderlyingObjectPropertiesTest.java @@ -0,0 +1,49 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UnderlyingObjectProperties + */ +public class UnderlyingObjectPropertiesTest { + private final UnderlyingObjectProperties model = new UnderlyingObjectProperties(); + + /** + * Model tests for UnderlyingObjectProperties + */ + @Test + public void testUnderlyingObjectProperties() { + // TODO: test UnderlyingObjectProperties + } + + /** + * Test the property 'storageClass' + */ + @Test + public void storageClassTest() { + // TODO: test storageClass + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/UpdateTokenTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UpdateTokenTest.java new file mode 100644 index 00000000000..5e431fb6b66 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UpdateTokenTest.java @@ -0,0 +1,48 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateToken + */ +public class UpdateTokenTest { + private final UpdateToken model = new UpdateToken(); + + /** + * Model tests for UpdateToken + */ + @Test + public void testUpdateToken() { + // TODO: test UpdateToken + } + + /** + * Test the property 'stagingToken' + */ + @Test + public void stagingTokenTest() { + // TODO: test stagingToken + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserCreationTest.java new file mode 100644 index 00000000000..90b249e4823 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserCreationTest.java @@ -0,0 +1,56 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UserCreation + */ +public class UserCreationTest { + private final UserCreation model = new UserCreation(); + + /** + * Model tests for UserCreation + */ + @Test + public void testUserCreation() { + // TODO: test UserCreation + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'inviteUser' + */ + @Test + public void inviteUserTest() { + // TODO: test inviteUser + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserListTest.java new file mode 100644 index 00000000000..ac7720ffc3a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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.lakefs.clients.sdk.model.Pagination; +import io.lakefs.clients.sdk.model.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UserList + */ +public class UserListTest { + private final UserList model = new UserList(); + + /** + * Model tests for UserList + */ + @Test + public void testUserList() { + // TODO: test UserList + } + + /** + * Test the property 'pagination' + */ + @Test + public void paginationTest() { + // TODO: test pagination + } + + /** + * Test the property 'results' + */ + @Test + public void resultsTest() { + // TODO: test results + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserTest.java new file mode 100644 index 00000000000..9cb60141d8a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/UserTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'creationDate' + */ + @Test + public void creationDateTest() { + // TODO: test creationDate + } + + /** + * Test the property 'friendlyName' + */ + @Test + public void friendlyNameTest() { + // TODO: test friendlyName + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/VersionConfigTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/VersionConfigTest.java new file mode 100644 index 00000000000..c753bcc8c0a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/VersionConfigTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.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.sdk.model; + +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 java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for VersionConfig + */ +public class VersionConfigTest { + private final VersionConfig model = new VersionConfig(); + + /** + * Model tests for VersionConfig + */ + @Test + public void testVersionConfig() { + // TODO: test VersionConfig + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'latestVersion' + */ + @Test + public void latestVersionTest() { + // TODO: test latestVersion + } + + /** + * Test the property 'upgradeRecommended' + */ + @Test + public void upgradeRecommendedTest() { + // TODO: test upgradeRecommended + } + + /** + * Test the property 'upgradeUrl' + */ + @Test + public void upgradeUrlTest() { + // TODO: test upgradeUrl + } + +}