diff --git a/api/swagger.yml b/api/swagger.yml index c01acb17ee2..c941675019f 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -1729,6 +1729,77 @@ components: type: object items: $ref: "#/components/schemas/ExternalPrincipalSettings" + + PullRequestBasic: + type: object + properties: + status: + type: string + enum: [ open, closed, merged ] + title: + type: string + description: + type: string + + PullRequest: + type: object + required: + - id + - status + - creation_date + - title + - author + - description + - source_branch + - destination_branch + allOf: + - $ref: '#/components/schemas/PullRequestBasic' + properties: + id: + type: string + creation_date: + type: integer + format: int64 + author: + type: string + source_branch: + type: string + destination_branch: + type: string + commit_id: + type: string + description: the commit id of merged PRs + + PullRequestsList: + type: object + required: + - pagination + - results + properties: + pagination: + $ref: "#/components/schemas/Pagination" + results: + type: array + items: + $ref: "#/components/schemas/PullRequest" + + PullRequestCreation: + type: object + required: + - title + - description + - source_branch + - destination_branch + properties: + title: + type: string + description: + type: string + source_branch: + type: string + destination_branch: + type: string + paths: /setup_comm_prefs: post: @@ -5582,6 +5653,159 @@ paths: description: too many requests default: $ref: "#/components/responses/ServerError" + + /repositories/{repository}/pulls: + parameters: + - in: path + name: repository + required: true + schema: + type: string + get: + tags: + - pulls + - experimental + operationId: listPullRequests + summary: list pull requests + parameters: + - $ref: "#/components/parameters/PaginationPrefix" + - $ref: "#/components/parameters/PaginationAfter" + - $ref: "#/components/parameters/PaginationAmount" + - in: query + name: state + schema: + type: string + enum: [ open, closed, all ] + default: all + description: filter pull requests by state + responses: + 200: + description: list of pull requests + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestsList" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + post: + tags: + - pulls + - experimental + operationId: createPullRequest + summary: create pull request + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestCreation" + responses: + 201: + description: pull request id + content: + text/html: + schema: + type: string + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 409: + $ref: "#/components/responses/Conflict" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + + /repositories/{repository}/pulls/{pull_request}: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: pull_request + required: true + description: pull request id + schema: + type: string + get: + tags: + - pulls + - experimental + operationId: getPullRequest + summary: get pull request + responses: + 200: + description: pull request + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequest" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + delete: + tags: + - pulls + - experimental + operationId: deletePullRequest + summary: delete pull request + responses: + 204: + description: pull request deleted successfully + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + patch: + tags: + - pulls + - experimental + operationId: updatePullRequest + summary: update pull request + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestBasic" + responses: + 204: + description: pull request deleted successfully + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + /healthcheck: get: operationId: healthCheck diff --git a/clients/java-legacy/.openapi-generator/FILES b/clients/java-legacy/.openapi-generator/FILES index 02a4661c9b7..8e60cdd4624 100644 --- a/clients/java-legacy/.openapi-generator/FILES +++ b/clients/java-legacy/.openapi-generator/FILES @@ -83,6 +83,11 @@ docs/PolicyList.md docs/PrepareGCUncommittedRequest.md docs/PrepareGCUncommittedResponse.md docs/PresignMultipartUpload.md +docs/PullRequest.md +docs/PullRequestBasic.md +docs/PullRequestCreation.md +docs/PullRequestsList.md +docs/PullsApi.md docs/RangeMetadata.md docs/Ref.md docs/RefList.md @@ -152,6 +157,7 @@ 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/PullsApi.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/ServerConfiguration.java @@ -229,6 +235,10 @@ 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/PresignMultipartUpload.java +src/main/java/io/lakefs/clients/api/model/PullRequest.java +src/main/java/io/lakefs/clients/api/model/PullRequestBasic.java +src/main/java/io/lakefs/clients/api/model/PullRequestCreation.java +src/main/java/io/lakefs/clients/api/model/PullRequestsList.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 @@ -275,6 +285,7 @@ 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/PullsApiTest.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/StagingApiTest.java @@ -345,6 +356,10 @@ 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/PresignMultipartUploadTest.java +src/test/java/io/lakefs/clients/api/model/PullRequestBasicTest.java +src/test/java/io/lakefs/clients/api/model/PullRequestCreationTest.java +src/test/java/io/lakefs/clients/api/model/PullRequestTest.java +src/test/java/io/lakefs/clients/api/model/PullRequestsListTest.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 diff --git a/clients/java-legacy/README.md b/clients/java-legacy/README.md index 302ea2993e1..63d45187320 100644 --- a/clients/java-legacy/README.md +++ b/clients/java-legacy/README.md @@ -189,13 +189,18 @@ Class | Method | HTTP request | Description *ExperimentalApi* | [**abortPresignMultipartUpload**](docs/ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload *ExperimentalApi* | [**completePresignMultipartUpload**](docs/ExperimentalApi.md#completePresignMultipartUpload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request *ExperimentalApi* | [**createPresignMultipartUpload**](docs/ExperimentalApi.md#createPresignMultipartUpload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +*ExperimentalApi* | [**createPullRequest**](docs/ExperimentalApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request *ExperimentalApi* | [**createUserExternalPrincipal**](docs/ExperimentalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +*ExperimentalApi* | [**deletePullRequest**](docs/ExperimentalApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request *ExperimentalApi* | [**deleteUserExternalPrincipal**](docs/ExperimentalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExperimentalApi* | [**externalPrincipalLogin**](docs/ExperimentalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator *ExperimentalApi* | [**getExternalPrincipal**](docs/ExperimentalApi.md#getExternalPrincipal) | **GET** /auth/external/principals | describe external principal by id +*ExperimentalApi* | [**getPullRequest**](docs/ExperimentalApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request *ExperimentalApi* | [**hardResetBranch**](docs/ExperimentalApi.md#hardResetBranch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +*ExperimentalApi* | [**listPullRequests**](docs/ExperimentalApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests *ExperimentalApi* | [**listUserExternalPrincipals**](docs/ExperimentalApi.md#listUserExternalPrincipals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user *ExperimentalApi* | [**stsLogin**](docs/ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS +*ExperimentalApi* | [**updatePullRequest**](docs/ExperimentalApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *ExternalApi* | [**createUserExternalPrincipal**](docs/ExternalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user *ExternalApi* | [**deleteUserExternalPrincipal**](docs/ExternalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExternalApi* | [**externalPrincipalLogin**](docs/ExternalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator @@ -244,6 +249,11 @@ Class | Method | HTTP request | Description *ObjectsApi* | [**listObjects**](docs/ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix *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 | +*PullsApi* | [**createPullRequest**](docs/PullsApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request +*PullsApi* | [**deletePullRequest**](docs/PullsApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +*PullsApi* | [**getPullRequest**](docs/PullsApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +*PullsApi* | [**listPullRequests**](docs/PullsApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests +*PullsApi* | [**updatePullRequest**](docs/PullsApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *RefsApi* | [**diffRefs**](docs/RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references *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. @@ -338,6 +348,10 @@ Class | Method | HTTP request | Description - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) - [PresignMultipartUpload](docs/PresignMultipartUpload.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestBasic](docs/PullRequestBasic.md) + - [PullRequestCreation](docs/PullRequestCreation.md) + - [PullRequestsList](docs/PullRequestsList.md) - [RangeMetadata](docs/RangeMetadata.md) - [Ref](docs/Ref.md) - [RefList](docs/RefList.md) diff --git a/clients/java-legacy/api/openapi.yaml b/clients/java-legacy/api/openapi.yaml index d73bd1e6465..227fe8eab9f 100644 --- a/clients/java-legacy/api/openapi.yaml +++ b/clients/java-legacy/api/openapi.yaml @@ -6758,6 +6758,318 @@ paths: - internal x-contentType: application/json x-accepts: application/json + /repositories/{repository}/pulls: + get: + operationId: listPullRequests + 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 + - explode: true + in: query + name: state + required: false + schema: + default: all + description: filter pull requests by state + enum: + - open + - closed + - all + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestsList' + description: list of pull requests + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list pull requests + tags: + - pulls + - experimental + x-accepts: application/json + post: + operationId: createPullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestCreation' + required: true + responses: + "201": + content: + text/html: + schema: + type: string + description: pull request id + "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/Error' + description: Resource Conflicts With Target + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create pull request + tags: + - pulls + - experimental + x-contentType: application/json + x-accepts: application/json + /repositories/{repository}/pulls/{pull_request}: + delete: + operationId: deletePullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + responses: + "204": + description: pull request 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 + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete pull request + tags: + - pulls + - experimental + x-accepts: application/json + get: + operationId: getPullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequest' + description: pull request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get pull request + tags: + - pulls + - experimental + x-accepts: application/json + patch: + operationId: updatePullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestBasic' + required: true + responses: + "204": + description: pull request 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 + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: update pull request + tags: + - pulls + - experimental + x-contentType: application/json + x-accepts: application/json /healthcheck: get: description: check that the API server is up and running @@ -9273,6 +9585,110 @@ components: - id - user_id type: object + PullRequestBasic: + example: + description: description + title: title + status: open + properties: + status: + enum: + - open + - closed + - merged + type: string + title: + type: string + description: + type: string + type: object + PullRequest: + allOf: + - $ref: '#/components/schemas/PullRequestBasic' + example: + author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + properties: + id: + type: string + creation_date: + format: int64 + type: integer + author: + type: string + source_branch: + type: string + destination_branch: + type: string + commit_id: + description: the commit id of merged PRs + type: string + required: + - author + - creation_date + - description + - destination_branch + - id + - source_branch + - status + - title + type: object + PullRequestsList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + - author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/PullRequest' + type: array + required: + - pagination + - results + type: object + PullRequestCreation: + example: + destination_branch: destination_branch + description: description + title: title + source_branch: source_branch + properties: + title: + type: string + description: + type: string + source_branch: + type: string + destination_branch: + type: string + required: + - description + - destination_branch + - source_branch + - title + type: object inline_object: properties: content: diff --git a/clients/java-legacy/docs/ExperimentalApi.md b/clients/java-legacy/docs/ExperimentalApi.md index 251f557b7b3..f6b1af07225 100644 --- a/clients/java-legacy/docs/ExperimentalApi.md +++ b/clients/java-legacy/docs/ExperimentalApi.md @@ -7,13 +7,18 @@ Method | HTTP request | Description [**abortPresignMultipartUpload**](ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload [**completePresignMultipartUpload**](ExperimentalApi.md#completePresignMultipartUpload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request [**createPresignMultipartUpload**](ExperimentalApi.md#createPresignMultipartUpload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +[**createPullRequest**](ExperimentalApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request [**createUserExternalPrincipal**](ExperimentalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +[**deletePullRequest**](ExperimentalApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request [**deleteUserExternalPrincipal**](ExperimentalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user [**externalPrincipalLogin**](ExperimentalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator [**getExternalPrincipal**](ExperimentalApi.md#getExternalPrincipal) | **GET** /auth/external/principals | describe external principal by id +[**getPullRequest**](ExperimentalApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request [**hardResetBranch**](ExperimentalApi.md#hardResetBranch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +[**listPullRequests**](ExperimentalApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests [**listUserExternalPrincipals**](ExperimentalApi.md#listUserExternalPrincipals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user [**stsLogin**](ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS +[**updatePullRequest**](ExperimentalApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request @@ -323,6 +328,103 @@ Name | Type | Description | Notes **420** | too many requests | - | **0** | Internal Server Error | - | + +# **createPullRequest** +> String createPullRequest(repository, pullRequestCreation) + +create pull request + +### 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 | + PullRequestCreation pullRequestCreation = new PullRequestCreation(); // PullRequestCreation | + try { + String result = apiInstance.createPullRequest(repository, pullRequestCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#createPullRequest"); + 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**| | + **pullRequestCreation** | [**PullRequestCreation**](PullRequestCreation.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** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + # **createUserExternalPrincipal** > createUserExternalPrincipal(userId, principalId, externalPrincipalCreation) @@ -419,6 +521,100 @@ null (empty response body) **420** | too many requests | - | **0** | Internal Server Error | - | + +# **deletePullRequest** +> deletePullRequest(repository, pullRequest) + +delete pull request + +### 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 pullRequest = "pullRequest_example"; // String | pull request id + try { + apiInstance.deletePullRequest(repository, pullRequest); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#deletePullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + +### 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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + # **deleteUserExternalPrincipal** > deleteUserExternalPrincipal(userId, principalId) @@ -670,6 +866,100 @@ Name | Type | Description | Notes **420** | too many requests | - | **0** | Internal Server Error | - | + +# **getPullRequest** +> PullRequest getPullRequest(repository, pullRequest) + +get pull request + +### 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 pullRequest = "pullRequest_example"; // String | pull request id + try { + PullRequest result = apiInstance.getPullRequest(repository, pullRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#getPullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.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** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + # **hardResetBranch** > hardResetBranch(repository, branch, ref, force) @@ -771,6 +1061,106 @@ null (empty response body) **420** | too many requests | - | **0** | Internal Server Error | - | + +# **listPullRequests** +> PullRequestsList listPullRequests(repository, prefix, after, amount, state) + +list pull requests + +### 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 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 + String state = "open"; // String | + try { + PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, state); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#listPullRequests"); + 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] + **state** | **String**| | [optional] [default to all] [enum: open, closed, all] + +### Return type + +[**PullRequestsList**](PullRequestsList.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 of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + # **listUserExternalPrincipals** > ExternalPrincipalList listUserExternalPrincipals(userId, prefix, after, amount) @@ -932,3 +1322,99 @@ No authorization required **420** | too many requests | - | **0** | Internal Server Error | - | + +# **updatePullRequest** +> updatePullRequest(repository, pullRequest, pullRequestBasic) + +update pull request + +### 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 pullRequest = "pullRequest_example"; // String | pull request id + PullRequestBasic pullRequestBasic = new PullRequestBasic(); // PullRequestBasic | + try { + apiInstance.updatePullRequest(repository, pullRequest, pullRequestBasic); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#updatePullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + **pullRequestBasic** | [**PullRequestBasic**](PullRequestBasic.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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/docs/PullRequest.md b/clients/java-legacy/docs/PullRequest.md new file mode 100644 index 00000000000..49ff6f9f75a --- /dev/null +++ b/clients/java-legacy/docs/PullRequest.md @@ -0,0 +1,31 @@ + + +# PullRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**creationDate** | **Long** | | +**author** | **String** | | +**sourceBranch** | **String** | | +**destinationBranch** | **String** | | +**commitId** | **String** | the commit id of merged PRs | [optional] +**status** | [**StatusEnum**](#StatusEnum) | | +**title** | **String** | | +**description** | **String** | | + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" +MERGED | "merged" + + + diff --git a/clients/java-legacy/docs/PullRequestBasic.md b/clients/java-legacy/docs/PullRequestBasic.md new file mode 100644 index 00000000000..7597aa560b4 --- /dev/null +++ b/clients/java-legacy/docs/PullRequestBasic.md @@ -0,0 +1,25 @@ + + +# PullRequestBasic + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**StatusEnum**](#StatusEnum) | | [optional] +**title** | **String** | | [optional] +**description** | **String** | | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" +MERGED | "merged" + + + diff --git a/clients/java-legacy/docs/PullRequestCreation.md b/clients/java-legacy/docs/PullRequestCreation.md new file mode 100644 index 00000000000..f5e41a272cd --- /dev/null +++ b/clients/java-legacy/docs/PullRequestCreation.md @@ -0,0 +1,16 @@ + + +# PullRequestCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | +**description** | **String** | | +**sourceBranch** | **String** | | +**destinationBranch** | **String** | | + + + diff --git a/clients/java-legacy/docs/PullRequestsList.md b/clients/java-legacy/docs/PullRequestsList.md new file mode 100644 index 00000000000..caa6e819683 --- /dev/null +++ b/clients/java-legacy/docs/PullRequestsList.md @@ -0,0 +1,14 @@ + + +# PullRequestsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List<PullRequest>**](PullRequest.md) | | + + + diff --git a/clients/java-legacy/docs/PullsApi.md b/clients/java-legacy/docs/PullsApi.md new file mode 100644 index 00000000000..f08423af8da --- /dev/null +++ b/clients/java-legacy/docs/PullsApi.md @@ -0,0 +1,494 @@ +# PullsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createPullRequest**](PullsApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request +[**deletePullRequest**](PullsApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +[**getPullRequest**](PullsApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +[**listPullRequests**](PullsApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests +[**updatePullRequest**](PullsApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request + + + +# **createPullRequest** +> String createPullRequest(repository, pullRequestCreation) + +create pull request + +### 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.PullsApi; + +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"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + PullRequestCreation pullRequestCreation = new PullRequestCreation(); // PullRequestCreation | + try { + String result = apiInstance.createPullRequest(repository, pullRequestCreation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#createPullRequest"); + 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**| | + **pullRequestCreation** | [**PullRequestCreation**](PullRequestCreation.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** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + + +# **deletePullRequest** +> deletePullRequest(repository, pullRequest) + +delete pull request + +### 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.PullsApi; + +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"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + try { + apiInstance.deletePullRequest(repository, pullRequest); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#deletePullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + +### 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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + + +# **getPullRequest** +> PullRequest getPullRequest(repository, pullRequest) + +get pull request + +### 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.PullsApi; + +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"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + try { + PullRequest result = apiInstance.getPullRequest(repository, pullRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#getPullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.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** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + + +# **listPullRequests** +> PullRequestsList listPullRequests(repository, prefix, after, amount, state) + +list pull requests + +### 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.PullsApi; + +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"); + + PullsApi apiInstance = new PullsApi(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 + String state = "open"; // String | + try { + PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, state); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#listPullRequests"); + 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] + **state** | **String**| | [optional] [default to all] [enum: open, closed, all] + +### Return type + +[**PullRequestsList**](PullRequestsList.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 of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + + +# **updatePullRequest** +> updatePullRequest(repository, pullRequest, pullRequestBasic) + +update pull request + +### 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.PullsApi; + +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"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + PullRequestBasic pullRequestBasic = new PullRequestBasic(); // PullRequestBasic | + try { + apiInstance.updatePullRequest(repository, pullRequest, pullRequestBasic); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#updatePullRequest"); + 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**| | + **pullRequest** | **String**| pull request id | + **pullRequestBasic** | [**PullRequestBasic**](PullRequestBasic.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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java index af8b8656512..5c2df9402d6 100644 --- a/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java @@ -37,6 +37,10 @@ import io.lakefs.clients.api.model.ExternalPrincipalList; import io.lakefs.clients.api.model.ObjectStats; import io.lakefs.clients.api.model.PresignMultipartUpload; +import io.lakefs.clients.api.model.PullRequest; +import io.lakefs.clients.api.model.PullRequestBasic; +import io.lakefs.clients.api.model.PullRequestCreation; +import io.lakefs.clients.api.model.PullRequestsList; import io.lakefs.clients.api.model.StagingLocation; import io.lakefs.clients.api.model.StsAuthRequest; @@ -566,6 +570,155 @@ public okhttp3.Call createPresignMultipartUploadAsync(String repository, String localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createPullRequest + * @param repository (required) + * @param pullRequestCreation (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call createPullRequestCall(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pullRequestCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls" + .replaceAll("\\{" + "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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPullRequestValidateBeforeCall(String repository, PullRequestCreation pullRequestCreation, 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 createPullRequest(Async)"); + } + + // verify the required parameter 'pullRequestCreation' is set + if (pullRequestCreation == null) { + throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); + } + + + okhttp3.Call localVarCall = createPullRequestCall(repository, pullRequestCreation, _callback); + return localVarCall; + + } + + /** + * create pull request + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public String createPullRequest(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + return localVarResp.getData(); + } + + /** + * create pull request + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse createPullRequestWithHttpInfo(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * create pull request (asynchronously) + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for createUserExternalPrincipal * @param userId (required) @@ -711,6 +864,144 @@ public okhttp3.Call createUserExternalPrincipalAsync(String userId, String princ localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for deletePullRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call deletePullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePullRequestValidateBeforeCall(String repository, String pullRequest, 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 deletePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling deletePullRequest(Async)"); + } + + + okhttp3.Call localVarCall = deletePullRequestCall(repository, pullRequest, _callback); + return localVarCall; + + } + + /** + * delete pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void deletePullRequest(String repository, String pullRequest) throws ApiException { + deletePullRequestWithHttpInfo(repository, pullRequest); + } + + /** + * delete pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse deletePullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * delete pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call deletePullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } /** * Build call for deleteUserExternalPrincipal * @param userId (required) @@ -1110,33 +1401,29 @@ public okhttp3.Call getExternalPrincipalAsync(String principalId, final ApiCallb return localVarCall; } /** - * Build call for hardResetBranch + * Build call for getPullRequest * @param repository (required) - * @param branch (required) - * @param ref After reset, branch will point at this reference. (required) - * @param force (optional, default to false) + * @param pullRequest pull request id (required) * @param _callback Callback for upload/download progress * @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 -
400 Bad Request -
200 pull request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call hardResetBranchCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getPullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/repositories/{repository}/branches/{branch}/hard_reset" + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) - .replaceAll("\\{" + "branch" + "\\}", localVarApiClient.escapeString(branch.toString())); + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1144,14 +1431,6 @@ public okhttp3.Call hardResetBranchCall(String repository, String branch, String Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (ref != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ref", ref)); - } - - if (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - final String[] localVarAccepts = { "application/json" }; @@ -1167,36 +1446,186 @@ public okhttp3.Call hardResetBranchCall(String repository, String branch, String localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call hardResetBranchValidateBeforeCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getPullRequestValidateBeforeCall(String repository, String pullRequest, 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 hardResetBranch(Async)"); - } - - // verify the required parameter 'branch' is set - if (branch == null) { - throw new ApiException("Missing the required parameter 'branch' when calling hardResetBranch(Async)"); + throw new ApiException("Missing the required parameter 'repository' when calling getPullRequest(Async)"); } - // verify the required parameter 'ref' is set - if (ref == null) { - throw new ApiException("Missing the required parameter 'ref' when calling hardResetBranch(Async)"); + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling getPullRequest(Async)"); } - okhttp3.Call localVarCall = hardResetBranchCall(repository, branch, ref, force, _callback); + okhttp3.Call localVarCall = getPullRequestCall(repository, pullRequest, _callback); return localVarCall; } /** - * hard reset branch - * Relocate branch to refer to ref. Branch must not contain uncommitted data. + * get pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return PullRequest + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequest getPullRequest(String repository, String pullRequest) throws ApiException { + ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); + return localVarResp.getData(); + } + + /** + * get pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return ApiResponse<PullRequest> + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse getPullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * get pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hardResetBranch + * @param repository (required) + * @param branch (required) + * @param ref After reset, branch will point at this reference. (required) + * @param force (optional, default to false) + * @param _callback Callback for upload/download progress + * @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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call hardResetBranchCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/hard_reset" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "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 (ref != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ref", ref)); + } + + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + + 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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hardResetBranchValidateBeforeCall(String repository, String branch, String ref, Boolean force, 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 hardResetBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling hardResetBranch(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling hardResetBranch(Async)"); + } + + + okhttp3.Call localVarCall = hardResetBranchCall(repository, branch, ref, force, _callback); + return localVarCall; + + } + + /** + * hard reset branch + * Relocate branch to refer to ref. Branch must not contain uncommitted data. * @param repository (required) * @param branch (required) * @param ref After reset, branch will point at this reference. (required) @@ -1272,6 +1701,166 @@ public okhttp3.Call hardResetBranchAsync(String repository, String branch, Strin localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for listPullRequests + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 list of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls" + .replaceAll("\\{" + "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)); + } + + if (state != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + } + + 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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, 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 listPullRequests(Async)"); + } + + + okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return localVarCall; + + } + + /** + * list pull requests + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @return PullRequestsList + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return localVarResp.getData(); + } + + /** + * list pull requests + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @return ApiResponse<PullRequestsList> + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list pull requests (asynchronously) + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listUserExternalPrincipals * @param userId (required) @@ -1547,4 +2136,151 @@ public okhttp3.Call stsLoginAsync(StsAuthRequest stsAuthRequest, final ApiCallba localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updatePullRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call updatePullRequestCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pullRequestBasic; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePullRequestValidateBeforeCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequestBasic' is set + if (pullRequestBasic == null) { + throw new ApiException("Missing the required parameter 'pullRequestBasic' when calling updatePullRequest(Async)"); + } + + + okhttp3.Call localVarCall = updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + return localVarCall; + + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void updatePullRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse updatePullRequestWithHttpInfo(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * update pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call updatePullRequestAsync(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java new file mode 100644 index 00000000000..bdf8102dd6e --- /dev/null +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java @@ -0,0 +1,793 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api; + +import io.lakefs.clients.api.ApiCallback; +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.ApiResponse; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.Pair; +import io.lakefs.clients.api.ProgressRequestBody; +import io.lakefs.clients.api.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.lakefs.clients.api.model.Error; +import io.lakefs.clients.api.model.PullRequest; +import io.lakefs.clients.api.model.PullRequestBasic; +import io.lakefs.clients.api.model.PullRequestCreation; +import io.lakefs.clients.api.model.PullRequestsList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PullsApi { + private ApiClient localVarApiClient; + + public PullsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PullsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for createPullRequest + * @param repository (required) + * @param pullRequestCreation (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call createPullRequestCall(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pullRequestCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls" + .replaceAll("\\{" + "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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPullRequestValidateBeforeCall(String repository, PullRequestCreation pullRequestCreation, 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 createPullRequest(Async)"); + } + + // verify the required parameter 'pullRequestCreation' is set + if (pullRequestCreation == null) { + throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); + } + + + okhttp3.Call localVarCall = createPullRequestCall(repository, pullRequestCreation, _callback); + return localVarCall; + + } + + /** + * create pull request + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public String createPullRequest(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + return localVarResp.getData(); + } + + /** + * create pull request + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse createPullRequestWithHttpInfo(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * create pull request (asynchronously) + * + * @param repository (required) + * @param pullRequestCreation (required) + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deletePullRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call deletePullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePullRequestValidateBeforeCall(String repository, String pullRequest, 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 deletePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling deletePullRequest(Async)"); + } + + + okhttp3.Call localVarCall = deletePullRequestCall(repository, pullRequest, _callback); + return localVarCall; + + } + + /** + * delete pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void deletePullRequest(String repository, String pullRequest) throws ApiException { + deletePullRequestWithHttpInfo(repository, pullRequest); + } + + /** + * delete pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse deletePullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * delete pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call deletePullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getPullRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call getPullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPullRequestValidateBeforeCall(String repository, String pullRequest, 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 getPullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling getPullRequest(Async)"); + } + + + okhttp3.Call localVarCall = getPullRequestCall(repository, pullRequest, _callback); + return localVarCall; + + } + + /** + * get pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return PullRequest + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequest getPullRequest(String repository, String pullRequest) throws ApiException { + ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); + return localVarResp.getData(); + } + + /** + * get pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return ApiResponse<PullRequest> + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse getPullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * get pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listPullRequests + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 list of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls" + .replaceAll("\\{" + "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)); + } + + if (state != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + } + + 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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, 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 listPullRequests(Async)"); + } + + + okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return localVarCall; + + } + + /** + * list pull requests + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @return PullRequestsList + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return localVarResp.getData(); + } + + /** + * list pull requests + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @return ApiResponse<PullRequestsList> + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list pull requests (asynchronously) + * + * @param repository (required) + * @param prefix return items prefixed with this value (optional) + * @param after return items after this value (optional) + * @param amount how many items to return (optional, default to 100) + * @param state (optional, default to all) + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePullRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call updatePullRequestCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pullRequestBasic; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "pull_request" + "\\}", localVarApiClient.escapeString(pullRequest.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePullRequestValidateBeforeCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequestBasic' is set + if (pullRequestBasic == null) { + throw new ApiException("Missing the required parameter 'pullRequestBasic' when calling updatePullRequest(Async)"); + } + + + okhttp3.Call localVarCall = updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + return localVarCall; + + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void updatePullRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse updatePullRequestWithHttpInfo(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * update pull request (asynchronously) + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call updatePullRequestAsync(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequest.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequest.java new file mode 100644 index 00000000000..99cd121e590 --- /dev/null +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequest.java @@ -0,0 +1,380 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.lakefs.clients.api.model.PullRequestBasic; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PullRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequest { + 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_AUTHOR = "author"; + @SerializedName(SERIALIZED_NAME_AUTHOR) + private String author; + + public static final String SERIALIZED_NAME_SOURCE_BRANCH = "source_branch"; + @SerializedName(SERIALIZED_NAME_SOURCE_BRANCH) + private String sourceBranch; + + public static final String SERIALIZED_NAME_DESTINATION_BRANCH = "destination_branch"; + @SerializedName(SERIALIZED_NAME_DESTINATION_BRANCH) + private String destinationBranch; + + public static final String SERIALIZED_NAME_COMMIT_ID = "commit_id"; + @SerializedName(SERIALIZED_NAME_COMMIT_ID) + private String commitId; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + CLOSED("closed"), + + MERGED("merged"); + + 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_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + + public PullRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PullRequest creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Get creationDate + * @return creationDate + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public PullRequest author(String author) { + + this.author = author; + return this; + } + + /** + * Get author + * @return author + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getAuthor() { + return author; + } + + + public void setAuthor(String author) { + this.author = author; + } + + + public PullRequest sourceBranch(String sourceBranch) { + + this.sourceBranch = sourceBranch; + return this; + } + + /** + * Get sourceBranch + * @return sourceBranch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getSourceBranch() { + return sourceBranch; + } + + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + + public PullRequest destinationBranch(String destinationBranch) { + + this.destinationBranch = destinationBranch; + return this; + } + + /** + * Get destinationBranch + * @return destinationBranch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getDestinationBranch() { + return destinationBranch; + } + + + public void setDestinationBranch(String destinationBranch) { + this.destinationBranch = destinationBranch; + } + + + public PullRequest commitId(String commitId) { + + this.commitId = commitId; + return this; + } + + /** + * the commit id of merged PRs + * @return commitId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the commit id of merged PRs") + + public String getCommitId() { + return commitId; + } + + + public void setCommitId(String commitId) { + this.commitId = commitId; + } + + + public PullRequest status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public PullRequest title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequest description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequest pullRequest = (PullRequest) o; + return Objects.equals(this.id, pullRequest.id) && + Objects.equals(this.creationDate, pullRequest.creationDate) && + Objects.equals(this.author, pullRequest.author) && + Objects.equals(this.sourceBranch, pullRequest.sourceBranch) && + Objects.equals(this.destinationBranch, pullRequest.destinationBranch) && + Objects.equals(this.commitId, pullRequest.commitId) && + Objects.equals(this.status, pullRequest.status) && + Objects.equals(this.title, pullRequest.title) && + Objects.equals(this.description, pullRequest.description); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, author, sourceBranch, destinationBranch, commitId, status, title, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" sourceBranch: ").append(toIndentedString(sourceBranch)).append("\n"); + sb.append(" destinationBranch: ").append(toIndentedString(destinationBranch)).append("\n"); + sb.append(" commitId: ").append(toIndentedString(commitId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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 "); + } + +} + diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestBasic.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestBasic.java new file mode 100644 index 00000000000..f4d1038da3f --- /dev/null +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestBasic.java @@ -0,0 +1,205 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PullRequestBasic + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestBasic { + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + CLOSED("closed"), + + MERGED("merged"); + + 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_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + + public PullRequestBasic status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public PullRequestBasic title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequestBasic description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestBasic pullRequestBasic = (PullRequestBasic) o; + return Objects.equals(this.status, pullRequestBasic.status) && + Objects.equals(this.title, pullRequestBasic.title) && + Objects.equals(this.description, pullRequestBasic.description); + } + + @Override + public int hashCode() { + return Objects.hash(status, title, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestBasic {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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 "); + } + +} + diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestCreation.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestCreation.java new file mode 100644 index 00000000000..b2419892cb8 --- /dev/null +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestCreation.java @@ -0,0 +1,185 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PullRequestCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestCreation { + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_SOURCE_BRANCH = "source_branch"; + @SerializedName(SERIALIZED_NAME_SOURCE_BRANCH) + private String sourceBranch; + + public static final String SERIALIZED_NAME_DESTINATION_BRANCH = "destination_branch"; + @SerializedName(SERIALIZED_NAME_DESTINATION_BRANCH) + private String destinationBranch; + + + public PullRequestCreation title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequestCreation description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public PullRequestCreation sourceBranch(String sourceBranch) { + + this.sourceBranch = sourceBranch; + return this; + } + + /** + * Get sourceBranch + * @return sourceBranch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getSourceBranch() { + return sourceBranch; + } + + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + + public PullRequestCreation destinationBranch(String destinationBranch) { + + this.destinationBranch = destinationBranch; + return this; + } + + /** + * Get destinationBranch + * @return destinationBranch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getDestinationBranch() { + return destinationBranch; + } + + + public void setDestinationBranch(String destinationBranch) { + this.destinationBranch = destinationBranch; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestCreation pullRequestCreation = (PullRequestCreation) o; + return Objects.equals(this.title, pullRequestCreation.title) && + Objects.equals(this.description, pullRequestCreation.description) && + Objects.equals(this.sourceBranch, pullRequestCreation.sourceBranch) && + Objects.equals(this.destinationBranch, pullRequestCreation.destinationBranch); + } + + @Override + public int hashCode() { + return Objects.hash(title, description, sourceBranch, destinationBranch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestCreation {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" sourceBranch: ").append(toIndentedString(sourceBranch)).append("\n"); + sb.append(" destinationBranch: ").append(toIndentedString(destinationBranch)).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 "); + } + +} + diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestsList.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestsList.java new file mode 100644 index 00000000000..e09480b16ad --- /dev/null +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/model/PullRequestsList.java @@ -0,0 +1,136 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.lakefs.clients.api.model.Pagination; +import io.lakefs.clients.api.model.PullRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * PullRequestsList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestsList { + 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 PullRequestsList pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + + public PullRequestsList results(List results) { + + this.results = results; + return this; + } + + public PullRequestsList addResultsItem(PullRequest resultsItem) { + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getResults() { + return results; + } + + + public void setResults(List results) { + this.results = results; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestsList pullRequestsList = (PullRequestsList) o; + return Objects.equals(this.pagination, pullRequestsList.pagination) && + Objects.equals(this.results, pullRequestsList.results); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestsList {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).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 "); + } + +} + diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java index 7de9cabd387..adafec2f22b 100644 --- a/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java @@ -24,6 +24,10 @@ import io.lakefs.clients.api.model.ExternalPrincipalList; import io.lakefs.clients.api.model.ObjectStats; import io.lakefs.clients.api.model.PresignMultipartUpload; +import io.lakefs.clients.api.model.PullRequest; +import io.lakefs.clients.api.model.PullRequestBasic; +import io.lakefs.clients.api.model.PullRequestCreation; +import io.lakefs.clients.api.model.PullRequestsList; import io.lakefs.clients.api.model.StagingLocation; import io.lakefs.clients.api.model.StsAuthRequest; import org.junit.Test; @@ -99,6 +103,22 @@ public void createPresignMultipartUploadTest() throws ApiException { // TODO: test validations } + /** + * create pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createPullRequestTest() throws ApiException { + String repository = null; + PullRequestCreation pullRequestCreation = null; + String response = api.createPullRequest(repository, pullRequestCreation); + // TODO: test validations + } + /** * attach external principal to user * @@ -116,6 +136,22 @@ public void createUserExternalPrincipalTest() throws ApiException { // TODO: test validations } + /** + * delete pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + api.deletePullRequest(repository, pullRequest); + // TODO: test validations + } + /** * delete external principal from user * @@ -162,6 +198,22 @@ public void getExternalPrincipalTest() throws ApiException { // TODO: test validations } + /** + * get pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequest response = api.getPullRequest(repository, pullRequest); + // TODO: test validations + } + /** * hard reset branch * @@ -180,6 +232,25 @@ public void hardResetBranchTest() throws ApiException { // TODO: test validations } + /** + * list pull requests + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void listPullRequestsTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + String state = null; + PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, state); + // TODO: test validations + } + /** * list user external policies attached to a user * @@ -213,4 +284,21 @@ public void stsLoginTest() throws ApiException { // TODO: test validations } + /** + * update pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequestBasic pullRequestBasic = null; + api.updatePullRequest(repository, pullRequest, pullRequestBasic); + // TODO: test validations + } + } diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java new file mode 100644 index 00000000000..10efd2a8dd6 --- /dev/null +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java @@ -0,0 +1,123 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api; + +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.model.Error; +import io.lakefs.clients.api.model.PullRequest; +import io.lakefs.clients.api.model.PullRequestBasic; +import io.lakefs.clients.api.model.PullRequestCreation; +import io.lakefs.clients.api.model.PullRequestsList; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PullsApi + */ +@Ignore +public class PullsApiTest { + + private final PullsApi api = new PullsApi(); + + + /** + * create pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createPullRequestTest() throws ApiException { + String repository = null; + PullRequestCreation pullRequestCreation = null; + String response = api.createPullRequest(repository, pullRequestCreation); + // TODO: test validations + } + + /** + * delete pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + api.deletePullRequest(repository, pullRequest); + // TODO: test validations + } + + /** + * get pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequest response = api.getPullRequest(repository, pullRequest); + // TODO: test validations + } + + /** + * list pull requests + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void listPullRequestsTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + String state = null; + PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, state); + // TODO: test validations + } + + /** + * update pull request + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequestBasic pullRequestBasic = null; + api.updatePullRequest(repository, pullRequest, pullRequestBasic); + // TODO: test validations + } + +} diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestBasicTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestBasicTest.java new file mode 100644 index 00000000000..39609a09c2c --- /dev/null +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestBasicTest.java @@ -0,0 +1,67 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PullRequestBasic + */ +public class PullRequestBasicTest { + private final PullRequestBasic model = new PullRequestBasic(); + + /** + * Model tests for PullRequestBasic + */ + @Test + public void testPullRequestBasic() { + // TODO: test PullRequestBasic + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + +} diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestCreationTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestCreationTest.java new file mode 100644 index 00000000000..8fc46b7ed98 --- /dev/null +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestCreationTest.java @@ -0,0 +1,75 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PullRequestCreation + */ +public class PullRequestCreationTest { + private final PullRequestCreation model = new PullRequestCreation(); + + /** + * Model tests for PullRequestCreation + */ + @Test + public void testPullRequestCreation() { + // TODO: test PullRequestCreation + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'sourceBranch' + */ + @Test + public void sourceBranchTest() { + // TODO: test sourceBranch + } + + /** + * Test the property 'destinationBranch' + */ + @Test + public void destinationBranchTest() { + // TODO: test destinationBranch + } + +} diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestTest.java new file mode 100644 index 00000000000..ae56d899e21 --- /dev/null +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestTest.java @@ -0,0 +1,68 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import 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.api.model.PullRequestBasic; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PullRequest + */ +public class PullRequestTest { + private final PullRequest model = new PullRequest(); + + /** + * Model tests for PullRequest + */ + @Test + public void testPullRequest() { + // TODO: test PullRequest + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + +} diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestsListTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestsListTest.java new file mode 100644 index 00000000000..bd2f89e4763 --- /dev/null +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/model/PullRequestsListTest.java @@ -0,0 +1,63 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import 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.api.model.Pagination; +import io.lakefs.clients.api.model.PullRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PullRequestsList + */ +public class PullRequestsListTest { + private final PullRequestsList model = new PullRequestsList(); + + /** + * Model tests for PullRequestsList + */ + @Test + public void testPullRequestsList() { + // TODO: test PullRequestsList + } + + /** + * 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/README.md b/clients/java/README.md index 805e4947aec..61e0b576bc3 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -197,13 +197,18 @@ Class | Method | HTTP request | Description *ExperimentalApi* | [**abortPresignMultipartUpload**](docs/ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload *ExperimentalApi* | [**completePresignMultipartUpload**](docs/ExperimentalApi.md#completePresignMultipartUpload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request *ExperimentalApi* | [**createPresignMultipartUpload**](docs/ExperimentalApi.md#createPresignMultipartUpload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +*ExperimentalApi* | [**createPullRequest**](docs/ExperimentalApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request *ExperimentalApi* | [**createUserExternalPrincipal**](docs/ExperimentalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +*ExperimentalApi* | [**deletePullRequest**](docs/ExperimentalApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request *ExperimentalApi* | [**deleteUserExternalPrincipal**](docs/ExperimentalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExperimentalApi* | [**externalPrincipalLogin**](docs/ExperimentalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator *ExperimentalApi* | [**getExternalPrincipal**](docs/ExperimentalApi.md#getExternalPrincipal) | **GET** /auth/external/principals | describe external principal by id +*ExperimentalApi* | [**getPullRequest**](docs/ExperimentalApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request *ExperimentalApi* | [**hardResetBranch**](docs/ExperimentalApi.md#hardResetBranch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +*ExperimentalApi* | [**listPullRequests**](docs/ExperimentalApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests *ExperimentalApi* | [**listUserExternalPrincipals**](docs/ExperimentalApi.md#listUserExternalPrincipals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user *ExperimentalApi* | [**stsLogin**](docs/ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS +*ExperimentalApi* | [**updatePullRequest**](docs/ExperimentalApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *ExternalApi* | [**createUserExternalPrincipal**](docs/ExternalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user *ExternalApi* | [**deleteUserExternalPrincipal**](docs/ExternalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExternalApi* | [**externalPrincipalLogin**](docs/ExternalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator @@ -252,6 +257,11 @@ Class | Method | HTTP request | Description *ObjectsApi* | [**listObjects**](docs/ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix *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 | +*PullsApi* | [**createPullRequest**](docs/PullsApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request +*PullsApi* | [**deletePullRequest**](docs/PullsApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +*PullsApi* | [**getPullRequest**](docs/PullsApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +*PullsApi* | [**listPullRequests**](docs/PullsApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests +*PullsApi* | [**updatePullRequest**](docs/PullsApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *RefsApi* | [**diffRefs**](docs/RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references *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. @@ -345,6 +355,10 @@ Class | Method | HTTP request | Description - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) - [PresignMultipartUpload](docs/PresignMultipartUpload.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestBasic](docs/PullRequestBasic.md) + - [PullRequestCreation](docs/PullRequestCreation.md) + - [PullRequestsList](docs/PullRequestsList.md) - [RangeMetadata](docs/RangeMetadata.md) - [Ref](docs/Ref.md) - [RefList](docs/RefList.md) diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index a58b3ef5514..5b5d46cc2ae 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -6747,6 +6747,318 @@ paths: - internal x-content-type: application/json x-accepts: application/json + /repositories/{repository}/pulls: + get: + operationId: listPullRequests + 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 + - explode: true + in: query + name: state + required: false + schema: + default: all + description: filter pull requests by state + enum: + - open + - closed + - all + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestsList' + description: list of pull requests + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: list pull requests + tags: + - pulls + - experimental + x-accepts: application/json + post: + operationId: createPullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestCreation' + required: true + responses: + "201": + content: + text/html: + schema: + type: string + description: pull request id + "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/Error' + description: Resource Conflicts With Target + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create pull request + tags: + - pulls + - experimental + x-content-type: application/json + x-accepts: application/json + /repositories/{repository}/pulls/{pull_request}: + delete: + operationId: deletePullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + responses: + "204": + description: pull request 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 + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: delete pull request + tags: + - pulls + - experimental + x-accepts: application/json + get: + operationId: getPullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequest' + description: pull request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get pull request + tags: + - pulls + - experimental + x-accepts: application/json + patch: + operationId: updatePullRequest + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: pull request id + explode: false + in: path + name: pull_request + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PullRequestBasic' + required: true + responses: + "204": + description: pull request 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 + "420": + description: too many requests + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: update pull request + tags: + - pulls + - experimental + x-content-type: application/json + x-accepts: application/json /healthcheck: get: description: check that the API server is up and running @@ -9248,6 +9560,110 @@ components: - id - user_id type: object + PullRequestBasic: + example: + description: description + title: title + status: open + properties: + status: + enum: + - open + - closed + - merged + type: string + title: + type: string + description: + type: string + type: object + PullRequest: + allOf: + - $ref: '#/components/schemas/PullRequestBasic' + example: + author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + properties: + id: + type: string + creation_date: + format: int64 + type: integer + author: + type: string + source_branch: + type: string + destination_branch: + type: string + commit_id: + description: the commit id of merged PRs + type: string + required: + - author + - creation_date + - description + - destination_branch + - id + - source_branch + - status + - title + type: object + PullRequestsList: + example: + pagination: + max_per_page: 0 + has_more: true + next_offset: next_offset + results: 0 + results: + - author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + - author: author + destination_branch: destination_branch + id: id + creation_date: 0 + commit_id: commit_id + source_branch: source_branch + properties: + pagination: + $ref: '#/components/schemas/Pagination' + results: + items: + $ref: '#/components/schemas/PullRequest' + type: array + required: + - pagination + - results + type: object + PullRequestCreation: + example: + destination_branch: destination_branch + description: description + title: title + source_branch: source_branch + properties: + title: + type: string + description: + type: string + source_branch: + type: string + destination_branch: + type: string + required: + - description + - destination_branch + - source_branch + - title + type: object uploadObject_request: properties: content: diff --git a/clients/java/docs/ExperimentalApi.md b/clients/java/docs/ExperimentalApi.md index fa6c9338b82..3fdde7644bb 100644 --- a/clients/java/docs/ExperimentalApi.md +++ b/clients/java/docs/ExperimentalApi.md @@ -7,13 +7,18 @@ All URIs are relative to */api/v1* | [**abortPresignMultipartUpload**](ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload | | [**completePresignMultipartUpload**](ExperimentalApi.md#completePresignMultipartUpload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request | | [**createPresignMultipartUpload**](ExperimentalApi.md#createPresignMultipartUpload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload | +| [**createPullRequest**](ExperimentalApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request | | [**createUserExternalPrincipal**](ExperimentalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user | +| [**deletePullRequest**](ExperimentalApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request | | [**deleteUserExternalPrincipal**](ExperimentalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user | | [**externalPrincipalLogin**](ExperimentalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator | | [**getExternalPrincipal**](ExperimentalApi.md#getExternalPrincipal) | **GET** /auth/external/principals | describe external principal by id | +| [**getPullRequest**](ExperimentalApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request | | [**hardResetBranch**](ExperimentalApi.md#hardResetBranch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch | +| [**listPullRequests**](ExperimentalApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests | | [**listUserExternalPrincipals**](ExperimentalApi.md#listUserExternalPrincipals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user | | [**stsLogin**](ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS | +| [**updatePullRequest**](ExperimentalApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request | @@ -329,6 +334,104 @@ public class Example { | **420** | too many requests | - | | **0** | Internal Server Error | - | + +# **createPullRequest** +> String createPullRequest(repository, pullRequestCreation).execute(); + +create pull request + +### Example +```java +// Import classes: +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("/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 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"); + + // 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 | + PullRequestCreation pullRequestCreation = new PullRequestCreation(); // PullRequestCreation | + try { + String result = apiInstance.createPullRequest(repository, pullRequestCreation) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#createPullRequest"); + 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**| | | +| **pullRequestCreation** | [**PullRequestCreation**](PullRequestCreation.md)| | | + +### Return type + +**String** + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | pull request id | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + # **createUserExternalPrincipal** > createUserExternalPrincipal(userId, principalId).externalPrincipalCreation(externalPrincipalCreation).execute(); @@ -427,6 +530,101 @@ null (empty response body) | **420** | too many requests | - | | **0** | Internal Server Error | - | + +# **deletePullRequest** +> deletePullRequest(repository, pullRequest).execute(); + +delete pull request + +### Example +```java +// Import classes: +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("/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 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"); + + // 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 pullRequest = "pullRequest_example"; // String | pull request id + try { + apiInstance.deletePullRequest(repository, pullRequest) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#deletePullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | + +### Return type + +null (empty response body) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | pull request deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + # **deleteUserExternalPrincipal** > deleteUserExternalPrincipal(userId, principalId).execute(); @@ -682,6 +880,101 @@ public class Example { | **420** | too many requests | - | | **0** | Internal Server Error | - | + +# **getPullRequest** +> PullRequest getPullRequest(repository, pullRequest).execute(); + +get pull request + +### Example +```java +// Import classes: +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("/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 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"); + + // 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 pullRequest = "pullRequest_example"; // String | pull request id + try { + PullRequest result = apiInstance.getPullRequest(repository, pullRequest) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#getPullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | pull request | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + # **hardResetBranch** > hardResetBranch(repository, branch, ref).force(force).execute(); @@ -785,6 +1078,111 @@ null (empty response body) | **420** | too many requests | - | | **0** | Internal Server Error | - | + +# **listPullRequests** +> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).state(state).execute(); + +list pull requests + +### Example +```java +// Import classes: +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("/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 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"); + + // 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 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 + String state = "open"; // String | + try { + PullRequestsList result = apiInstance.listPullRequests(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .state(state) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#listPullRequests"); + 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] | +| **state** | **String**| | [optional] [default to all] [enum: open, closed, all] | + +### Return type + +[**PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | list of pull requests | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + # **listUserExternalPrincipals** > ExternalPrincipalList listUserExternalPrincipals(userId).prefix(prefix).after(after).amount(amount).execute(); @@ -951,3 +1349,100 @@ No authorization required | **420** | too many requests | - | | **0** | Internal Server Error | - | + +# **updatePullRequest** +> updatePullRequest(repository, pullRequest, pullRequestBasic).execute(); + +update pull request + +### Example +```java +// Import classes: +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("/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 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"); + + // 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 pullRequest = "pullRequest_example"; // String | pull request id + PullRequestBasic pullRequestBasic = new PullRequestBasic(); // PullRequestBasic | + try { + apiInstance.updatePullRequest(repository, pullRequest, pullRequestBasic) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#updatePullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | +| **pullRequestBasic** | [**PullRequestBasic**](PullRequestBasic.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | pull request deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + diff --git a/clients/java/docs/PullRequest.md b/clients/java/docs/PullRequest.md new file mode 100644 index 00000000000..0101c7424cf --- /dev/null +++ b/clients/java/docs/PullRequest.md @@ -0,0 +1,31 @@ + + +# PullRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**creationDate** | **Long** | | | +|**author** | **String** | | | +|**sourceBranch** | **String** | | | +|**destinationBranch** | **String** | | | +|**commitId** | **String** | the commit id of merged PRs | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | | | +|**title** | **String** | | | +|**description** | **String** | | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "open" | +| CLOSED | "closed" | +| MERGED | "merged" | + + + diff --git a/clients/java/docs/PullRequestBasic.md b/clients/java/docs/PullRequestBasic.md new file mode 100644 index 00000000000..5d9a706a71a --- /dev/null +++ b/clients/java/docs/PullRequestBasic.md @@ -0,0 +1,25 @@ + + +# PullRequestBasic + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | [**StatusEnum**](#StatusEnum) | | [optional] | +|**title** | **String** | | [optional] | +|**description** | **String** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| OPEN | "open" | +| CLOSED | "closed" | +| MERGED | "merged" | + + + diff --git a/clients/java/docs/PullRequestCreation.md b/clients/java/docs/PullRequestCreation.md new file mode 100644 index 00000000000..17c6907544b --- /dev/null +++ b/clients/java/docs/PullRequestCreation.md @@ -0,0 +1,16 @@ + + +# PullRequestCreation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**title** | **String** | | | +|**description** | **String** | | | +|**sourceBranch** | **String** | | | +|**destinationBranch** | **String** | | | + + + diff --git a/clients/java/docs/PullRequestsList.md b/clients/java/docs/PullRequestsList.md new file mode 100644 index 00000000000..87798d4bdac --- /dev/null +++ b/clients/java/docs/PullRequestsList.md @@ -0,0 +1,14 @@ + + +# PullRequestsList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pagination** | [**Pagination**](Pagination.md) | | | +|**results** | [**List<PullRequest>**](PullRequest.md) | | | + + + diff --git a/clients/java/docs/PullsApi.md b/clients/java/docs/PullsApi.md new file mode 100644 index 00000000000..6f24e7fa7ec --- /dev/null +++ b/clients/java/docs/PullsApi.md @@ -0,0 +1,503 @@ +# PullsApi + +All URIs are relative to */api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createPullRequest**](PullsApi.md#createPullRequest) | **POST** /repositories/{repository}/pulls | create pull request | +| [**deletePullRequest**](PullsApi.md#deletePullRequest) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request | +| [**getPullRequest**](PullsApi.md#getPullRequest) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request | +| [**listPullRequests**](PullsApi.md#listPullRequests) | **GET** /repositories/{repository}/pulls | list pull requests | +| [**updatePullRequest**](PullsApi.md#updatePullRequest) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request | + + + +# **createPullRequest** +> String createPullRequest(repository, pullRequestCreation).execute(); + +create pull request + +### Example +```java +// Import classes: +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.PullsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/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 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"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + PullRequestCreation pullRequestCreation = new PullRequestCreation(); // PullRequestCreation | + try { + String result = apiInstance.createPullRequest(repository, pullRequestCreation) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#createPullRequest"); + 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**| | | +| **pullRequestCreation** | [**PullRequestCreation**](PullRequestCreation.md)| | | + +### Return type + +**String** + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | pull request id | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + + +# **deletePullRequest** +> deletePullRequest(repository, pullRequest).execute(); + +delete pull request + +### Example +```java +// Import classes: +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.PullsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/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 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"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + try { + apiInstance.deletePullRequest(repository, pullRequest) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#deletePullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | + +### Return type + +null (empty response body) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | pull request deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + + +# **getPullRequest** +> PullRequest getPullRequest(repository, pullRequest).execute(); + +get pull request + +### Example +```java +// Import classes: +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.PullsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/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 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"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + try { + PullRequest result = apiInstance.getPullRequest(repository, pullRequest) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#getPullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | pull request | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + + +# **listPullRequests** +> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).state(state).execute(); + +list pull requests + +### Example +```java +// Import classes: +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.PullsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/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 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"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + PullsApi apiInstance = new PullsApi(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 + String state = "open"; // String | + try { + PullRequestsList result = apiInstance.listPullRequests(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .state(state) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#listPullRequests"); + 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] | +| **state** | **String**| | [optional] [default to all] [enum: open, closed, all] | + +### Return type + +[**PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | list of pull requests | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + + +# **updatePullRequest** +> updatePullRequest(repository, pullRequest, pullRequestBasic).execute(); + +update pull request + +### Example +```java +// Import classes: +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.PullsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/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 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"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + PullsApi apiInstance = new PullsApi(defaultClient); + String repository = "repository_example"; // String | + String pullRequest = "pullRequest_example"; // String | pull request id + PullRequestBasic pullRequestBasic = new PullRequestBasic(); // PullRequestBasic | + try { + apiInstance.updatePullRequest(repository, pullRequest, pullRequestBasic) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling PullsApi#updatePullRequest"); + 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**| | | +| **pullRequest** | **String**| pull request id | | +| **pullRequestBasic** | [**PullRequestBasic**](PullRequestBasic.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | pull request deleted successfully | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **420** | too many requests | - | +| **0** | Internal Server Error | - | + 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 index bd2b171ed2c..aff5bf85374 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java @@ -37,6 +37,10 @@ import io.lakefs.clients.sdk.model.ExternalPrincipalList; import io.lakefs.clients.sdk.model.ObjectStats; import io.lakefs.clients.sdk.model.PresignMultipartUpload; +import io.lakefs.clients.sdk.model.PullRequest; +import io.lakefs.clients.sdk.model.PullRequestBasic; +import io.lakefs.clients.sdk.model.PullRequestCreation; +import io.lakefs.clients.sdk.model.PullRequestsList; import io.lakefs.clients.sdk.model.StagingLocation; import io.lakefs.clients.sdk.model.StsAuthRequest; @@ -735,7 +739,7 @@ public okhttp3.Call executeAsync(final ApiCallback _call public APIcreatePresignMultipartUploadRequest createPresignMultipartUpload(String repository, String branch, String path) { return new APIcreatePresignMultipartUploadRequest(repository, branch, path); } - private okhttp3.Call createUserExternalPrincipalCall(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createPullRequestCall(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -749,11 +753,11 @@ private okhttp3.Call createUserExternalPrincipalCall(String userId, String princ basePath = null; } - Object localVarPostBody = externalPrincipalCreation; + Object localVarPostBody = pullRequestCreation; // create path and map variables - String localVarPath = "/auth/users/{userId}/external/principals" - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = "/repositories/{repository}/pulls" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -761,11 +765,8 @@ private okhttp3.Call createUserExternalPrincipalCall(String userId, String princ Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (principalId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("principalId", principalId)); - } - final String[] localVarAccepts = { + "text/html", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); @@ -786,64 +787,57 @@ private okhttp3.Call createUserExternalPrincipalCall(String userId, String princ } @SuppressWarnings("rawtypes") - private okhttp3.Call createUserExternalPrincipalValidateBeforeCall(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, 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 createUserExternalPrincipal(Async)"); + private okhttp3.Call createPullRequestValidateBeforeCall(String repository, PullRequestCreation pullRequestCreation, 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 createPullRequest(Async)"); } - // verify the required parameter 'principalId' is set - if (principalId == null) { - throw new ApiException("Missing the required parameter 'principalId' when calling createUserExternalPrincipal(Async)"); + // verify the required parameter 'pullRequestCreation' is set + if (pullRequestCreation == null) { + throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); } - return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); + return createPullRequestCall(repository, pullRequestCreation, _callback); } - private ApiResponse createUserExternalPrincipalWithHttpInfo(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation) throws ApiException { - okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, null); - return localVarApiClient.execute(localVarCall); + private ApiResponse createPullRequestWithHttpInfo(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call createUserExternalPrincipalAsync(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIcreateUserExternalPrincipalRequest { - private final String userId; - private final String principalId; - private ExternalPrincipalCreation externalPrincipalCreation; - - private APIcreateUserExternalPrincipalRequest(String userId, String principalId) { - this.userId = userId; - this.principalId = principalId; - } + public class APIcreatePullRequestRequest { + private final String repository; + private final PullRequestCreation pullRequestCreation; - /** - * Set externalPrincipalCreation - * @param externalPrincipalCreation (optional) - * @return APIcreateUserExternalPrincipalRequest - */ - public APIcreateUserExternalPrincipalRequest externalPrincipalCreation(ExternalPrincipalCreation externalPrincipalCreation) { - this.externalPrincipalCreation = externalPrincipalCreation; - return this; + private APIcreatePullRequestRequest(String repository, PullRequestCreation pullRequestCreation) { + this.repository = repository; + this.pullRequestCreation = pullRequestCreation; } /** - * Build call for createUserExternalPrincipal + * Build call for createPullRequest * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + + + @@ -851,88 +845,98 @@ public APIcreateUserExternalPrincipalRequest externalPrincipalCreation(ExternalP
Status Code Description Response Headers
201 external principal attached successfully -
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); + return createPullRequestCall(repository, pullRequestCreation, _callback); } /** - * Execute createUserExternalPrincipal request + * Execute createPullRequest 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 external principal attached successfully -
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ - public void execute() throws ApiException { - createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); + public String execute() throws ApiException { + ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + return localVarResp.getData(); } /** - * Execute createUserExternalPrincipal request with HTTP info returned - * @return ApiResponse<Void> + * Execute createPullRequest 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 external principal attached successfully -
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); + public ApiResponse executeWithHttpInfo() throws ApiException { + return createPullRequestWithHttpInfo(repository, pullRequestCreation); } /** - * Execute createUserExternalPrincipal request (asynchronously) + * Execute createPullRequest 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 external principal attached successfully -
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return createUserExternalPrincipalAsync(userId, principalId, externalPrincipalCreation, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createPullRequestAsync(repository, pullRequestCreation, _callback); } } /** - * attach external principal to user + * create pull request * - * @param userId (required) - * @param principalId (required) - * @return APIcreateUserExternalPrincipalRequest + * @param repository (required) + * @param pullRequestCreation (required) + * @return APIcreatePullRequestRequest * @http.response.details - + + +
Status Code Description Response Headers
201 external principal attached successfully -
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ - public APIcreateUserExternalPrincipalRequest createUserExternalPrincipal(String userId, String principalId) { - return new APIcreateUserExternalPrincipalRequest(userId, principalId); + public APIcreatePullRequestRequest createPullRequest(String repository, PullRequestCreation pullRequestCreation) { + return new APIcreatePullRequestRequest(repository, pullRequestCreation); } - private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserExternalPrincipalCall(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -946,7 +950,7 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = externalPrincipalCreation; // create path and map variables String localVarPath = "/auth/users/{userId}/external/principals" @@ -971,6 +975,7 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -978,141 +983,157 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ } 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); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteUserExternalPrincipalValidateBeforeCall(String userId, String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserExternalPrincipalValidateBeforeCall(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, 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 deleteUserExternalPrincipal(Async)"); + throw new ApiException("Missing the required parameter 'userId' when calling createUserExternalPrincipal(Async)"); } // verify the required parameter 'principalId' is set if (principalId == null) { - throw new ApiException("Missing the required parameter 'principalId' when calling deleteUserExternalPrincipal(Async)"); + throw new ApiException("Missing the required parameter 'principalId' when calling createUserExternalPrincipal(Async)"); } - return deleteUserExternalPrincipalCall(userId, principalId, _callback); + return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); } - private ApiResponse deleteUserExternalPrincipalWithHttpInfo(String userId, String principalId) throws ApiException { - okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, null); + private ApiResponse createUserExternalPrincipalWithHttpInfo(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation) throws ApiException { + okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, null); return localVarApiClient.execute(localVarCall); } - private okhttp3.Call deleteUserExternalPrincipalAsync(String userId, String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserExternalPrincipalAsync(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, _callback); + okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - public class APIdeleteUserExternalPrincipalRequest { + public class APIcreateUserExternalPrincipalRequest { private final String userId; private final String principalId; + private ExternalPrincipalCreation externalPrincipalCreation; - private APIdeleteUserExternalPrincipalRequest(String userId, String principalId) { + private APIcreateUserExternalPrincipalRequest(String userId, String principalId) { this.userId = userId; this.principalId = principalId; } /** - * Build call for deleteUserExternalPrincipal + * Set externalPrincipalCreation + * @param externalPrincipalCreation (optional) + * @return APIcreateUserExternalPrincipalRequest + */ + public APIcreateUserExternalPrincipalRequest externalPrincipalCreation(ExternalPrincipalCreation externalPrincipalCreation) { + this.externalPrincipalCreation = externalPrincipalCreation; + return this; + } + + /** + * Build call for createUserExternalPrincipal * @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 external principal detached successfully -
201 external principal attached successfully -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return deleteUserExternalPrincipalCall(userId, principalId, _callback); + return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); } /** - * Execute deleteUserExternalPrincipal request + * Execute createUserExternalPrincipal 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 external principal detached successfully -
201 external principal attached successfully -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public void execute() throws ApiException { - deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); } /** - * Execute deleteUserExternalPrincipal request with HTTP info returned + * Execute createUserExternalPrincipal 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 external principal detached successfully -
201 external principal attached successfully -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { - return deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + return createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); } /** - * Execute deleteUserExternalPrincipal request (asynchronously) + * Execute createUserExternalPrincipal 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 external principal detached successfully -
201 external principal attached successfully -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return deleteUserExternalPrincipalAsync(userId, principalId, _callback); + return createUserExternalPrincipalAsync(userId, principalId, externalPrincipalCreation, _callback); } } /** - * delete external principal from user + * attach external principal to user * * @param userId (required) * @param principalId (required) - * @return APIdeleteUserExternalPrincipalRequest + * @return APIcreateUserExternalPrincipalRequest * @http.response.details - + +
Status Code Description Response Headers
204 external principal detached successfully -
201 external principal attached successfully -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ - public APIdeleteUserExternalPrincipalRequest deleteUserExternalPrincipal(String userId, String principalId) { - return new APIdeleteUserExternalPrincipalRequest(userId, principalId); + public APIcreateUserExternalPrincipalRequest createUserExternalPrincipal(String userId, String principalId) { + return new APIcreateUserExternalPrincipalRequest(userId, principalId); } - private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deletePullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1126,10 +1147,12 @@ private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externa basePath = null; } - Object localVarPostBody = externalLoginInformation; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/external/principal/login"; + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1146,64 +1169,63 @@ private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externa } 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); + 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 externalPrincipalLoginValidateBeforeCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { - return externalPrincipalLoginCall(externalLoginInformation, _callback); + private okhttp3.Call deletePullRequestValidateBeforeCall(String repository, String pullRequest, 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 deletePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling deletePullRequest(Async)"); + } + + return deletePullRequestCall(repository, pullRequest, _callback); } - private ApiResponse externalPrincipalLoginWithHttpInfo(ExternalLoginInformation externalLoginInformation) throws ApiException { - okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + private ApiResponse deletePullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, null); + return localVarApiClient.execute(localVarCall); } - private okhttp3.Call externalPrincipalLoginAsync(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deletePullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - public class APIexternalPrincipalLoginRequest { - private ExternalLoginInformation externalLoginInformation; - - private APIexternalPrincipalLoginRequest() { - } + public class APIdeletePullRequestRequest { + private final String repository; + private final String pullRequest; - /** - * Set externalLoginInformation - * @param externalLoginInformation (optional) - * @return APIexternalPrincipalLoginRequest - */ - public APIexternalPrincipalLoginRequest externalLoginInformation(ExternalLoginInformation externalLoginInformation) { - this.externalLoginInformation = externalLoginInformation; - return this; + private APIdeletePullRequestRequest(String repository, String pullRequest) { + this.repository = repository; + this.pullRequest = pullRequest; } /** - * Build call for externalPrincipalLogin + * Build call for deletePullRequest * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - + @@ -1212,18 +1234,16 @@ public APIexternalPrincipalLoginRequest externalLoginInformation(ExternalLoginIn
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return externalPrincipalLoginCall(externalLoginInformation, _callback); + return deletePullRequestCall(repository, pullRequest, _callback); } /** - * Execute externalPrincipalLogin request - * @return AuthenticationToken + * Execute deletePullRequest request * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + @@ -1231,20 +1251,18 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
*/ - public AuthenticationToken execute() throws ApiException { - ApiResponse localVarResp = externalPrincipalLoginWithHttpInfo(externalLoginInformation); - return localVarResp.getData(); + public void execute() throws ApiException { + deletePullRequestWithHttpInfo(repository, pullRequest); } /** - * Execute externalPrincipalLogin request with HTTP info returned - * @return ApiResponse<AuthenticationToken> + * Execute deletePullRequest 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 - - + @@ -1252,20 +1270,19 @@ public AuthenticationToken execute() throws ApiException {
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return externalPrincipalLoginWithHttpInfo(externalLoginInformation); + public ApiResponse executeWithHttpInfo() throws ApiException { + return deletePullRequestWithHttpInfo(repository, pullRequest); } /** - * Execute externalPrincipalLogin request (asynchronously) + * Execute deletePullRequest 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 - - + @@ -1273,20 +1290,21 @@ public ApiResponse executeWithHttpInfo() throws ApiExceptio
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return externalPrincipalLoginAsync(externalLoginInformation, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deletePullRequestAsync(repository, pullRequest, _callback); } } /** - * perform a login using an external authenticator + * delete pull request * - * @return APIexternalPrincipalLoginRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @return APIdeletePullRequestRequest * @http.response.details - - + @@ -1294,10 +1312,10 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
0 Internal Server Error -
*/ - public APIexternalPrincipalLoginRequest externalPrincipalLogin() { - return new APIexternalPrincipalLoginRequest(); + public APIdeletePullRequestRequest deletePullRequest(String repository, String pullRequest) { + return new APIdeletePullRequestRequest(repository, pullRequest); } - private okhttp3.Call getExternalPrincipalCall(String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String principalId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1314,7 +1332,8 @@ private okhttp3.Call getExternalPrincipalCall(String principalId, final ApiCallb Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/external/principals"; + String localVarPath = "/auth/users/{userId}/external/principals" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1342,51 +1361,595 @@ private okhttp3.Call getExternalPrincipalCall(String principalId, final ApiCallb } 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); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getExternalPrincipalValidateBeforeCall(String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteUserExternalPrincipalValidateBeforeCall(String userId, String principalId, 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 deleteUserExternalPrincipal(Async)"); + } + // verify the required parameter 'principalId' is set if (principalId == null) { - throw new ApiException("Missing the required parameter 'principalId' when calling getExternalPrincipal(Async)"); + throw new ApiException("Missing the required parameter 'principalId' when calling deleteUserExternalPrincipal(Async)"); } - return getExternalPrincipalCall(principalId, _callback); + return deleteUserExternalPrincipalCall(userId, principalId, _callback); } - private ApiResponse getExternalPrincipalWithHttpInfo(String principalId) throws ApiException { - okhttp3.Call localVarCall = getExternalPrincipalValidateBeforeCall(principalId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + private ApiResponse deleteUserExternalPrincipalWithHttpInfo(String userId, String principalId) throws ApiException { + okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, null); + return localVarApiClient.execute(localVarCall); } - private okhttp3.Call getExternalPrincipalAsync(String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteUserExternalPrincipalAsync(String userId, String principalId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getExternalPrincipalValidateBeforeCall(principalId, _callback); + okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeleteUserExternalPrincipalRequest { + private final String userId; + private final String principalId; + + private APIdeleteUserExternalPrincipalRequest(String userId, String principalId) { + this.userId = userId; + this.principalId = principalId; + } + + /** + * Build call for deleteUserExternalPrincipal + * @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 external principal detached successfully -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deleteUserExternalPrincipalCall(userId, principalId, _callback); + } + + /** + * Execute deleteUserExternalPrincipal 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 external principal detached successfully -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + } + + /** + * Execute deleteUserExternalPrincipal 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 external principal detached successfully -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + } + + /** + * Execute deleteUserExternalPrincipal 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 external principal detached successfully -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deleteUserExternalPrincipalAsync(userId, principalId, _callback); + } + } + + /** + * delete external principal from user + * + * @param userId (required) + * @param principalId (required) + * @return APIdeleteUserExternalPrincipalRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 external principal detached successfully -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIdeleteUserExternalPrincipalRequest deleteUserExternalPrincipal(String userId, String principalId) { + return new APIdeleteUserExternalPrincipalRequest(userId, principalId); + } + private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externalLoginInformation, 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 = externalLoginInformation; + + // create path and map variables + String localVarPath = "/auth/external/principal/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 externalPrincipalLoginValidateBeforeCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + return externalPrincipalLoginCall(externalLoginInformation, _callback); + + } + + + private ApiResponse externalPrincipalLoginWithHttpInfo(ExternalLoginInformation externalLoginInformation) throws ApiException { + okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call externalPrincipalLoginAsync(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIexternalPrincipalLoginRequest { + private ExternalLoginInformation externalLoginInformation; + + private APIexternalPrincipalLoginRequest() { + } + + /** + * Set externalLoginInformation + * @param externalLoginInformation (optional) + * @return APIexternalPrincipalLoginRequest + */ + public APIexternalPrincipalLoginRequest externalLoginInformation(ExternalLoginInformation externalLoginInformation) { + this.externalLoginInformation = externalLoginInformation; + return this; + } + + /** + * Build call for externalPrincipalLogin + * @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 external login -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return externalPrincipalLoginCall(externalLoginInformation, _callback); + } + + /** + * Execute externalPrincipalLogin 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 external login -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public AuthenticationToken execute() throws ApiException { + ApiResponse localVarResp = externalPrincipalLoginWithHttpInfo(externalLoginInformation); + return localVarResp.getData(); + } + + /** + * Execute externalPrincipalLogin 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 external login -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return externalPrincipalLoginWithHttpInfo(externalLoginInformation); + } + + /** + * Execute externalPrincipalLogin 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 external login -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return externalPrincipalLoginAsync(externalLoginInformation, _callback); + } + } + + /** + * perform a login using an external authenticator + * + * @return APIexternalPrincipalLoginRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 successful external login -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIexternalPrincipalLoginRequest externalPrincipalLogin() { + return new APIexternalPrincipalLoginRequest(); + } + private okhttp3.Call getExternalPrincipalCall(String principalId, 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/external/principals"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (principalId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("principalId", principalId)); + } + + 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 getExternalPrincipalValidateBeforeCall(String principalId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'principalId' is set + if (principalId == null) { + throw new ApiException("Missing the required parameter 'principalId' when calling getExternalPrincipal(Async)"); + } + + return getExternalPrincipalCall(principalId, _callback); + + } + + + private ApiResponse getExternalPrincipalWithHttpInfo(String principalId) throws ApiException { + okhttp3.Call localVarCall = getExternalPrincipalValidateBeforeCall(principalId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getExternalPrincipalAsync(String principalId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getExternalPrincipalValidateBeforeCall(principalId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetExternalPrincipalRequest { - private final String principalId; + public class APIgetExternalPrincipalRequest { + private final String principalId; + + private APIgetExternalPrincipalRequest(String principalId) { + this.principalId = principalId; + } + + /** + * Build call for getExternalPrincipal + * @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 external principal -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getExternalPrincipalCall(principalId, _callback); + } + + /** + * Execute getExternalPrincipal request + * @return ExternalPrincipal + * @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 external principal -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ExternalPrincipal execute() throws ApiException { + ApiResponse localVarResp = getExternalPrincipalWithHttpInfo(principalId); + return localVarResp.getData(); + } + + /** + * Execute getExternalPrincipal request with HTTP info returned + * @return ApiResponse<ExternalPrincipal> + * @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 external principal -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getExternalPrincipalWithHttpInfo(principalId); + } + + /** + * Execute getExternalPrincipal 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 external principal -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getExternalPrincipalAsync(principalId, _callback); + } + } + + /** + * describe external principal by id + * + * @param principalId (required) + * @return APIgetExternalPrincipalRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 external principal -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIgetExternalPrincipalRequest getExternalPrincipal(String principalId) { + return new APIgetExternalPrincipalRequest(principalId); + } + private okhttp3.Call getPullRequestCall(String repository, String pullRequest, 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}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.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 getPullRequestValidateBeforeCall(String repository, String pullRequest, 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 getPullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling getPullRequest(Async)"); + } + + return getPullRequestCall(repository, pullRequest, _callback); + + } + + + private ApiResponse getPullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetPullRequestRequest { + private final String repository; + private final String pullRequest; - private APIgetExternalPrincipalRequest(String principalId) { - this.principalId = principalId; + private APIgetPullRequestRequest(String repository, String pullRequest) { + this.repository = repository; + this.pullRequest = pullRequest; } /** - * Build call for getExternalPrincipal + * Build call for getPullRequest * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + @@ -1394,83 +1957,84 @@ private APIgetExternalPrincipalRequest(String principalId) {
Status Code Description Response Headers
200 external principal -
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getExternalPrincipalCall(principalId, _callback); + return getPullRequestCall(repository, pullRequest, _callback); } /** - * Execute getExternalPrincipal request - * @return ExternalPrincipal + * Execute getPullRequest request + * @return PullRequest * @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 external principal -
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public ExternalPrincipal execute() throws ApiException { - ApiResponse localVarResp = getExternalPrincipalWithHttpInfo(principalId); + public PullRequest execute() throws ApiException { + ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); return localVarResp.getData(); } /** - * Execute getExternalPrincipal request with HTTP info returned - * @return ApiResponse<ExternalPrincipal> + * Execute getPullRequest request with HTTP info returned + * @return ApiResponse<PullRequest> * @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 external principal -
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getExternalPrincipalWithHttpInfo(principalId); + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPullRequestWithHttpInfo(repository, pullRequest); } /** - * Execute getExternalPrincipal request (asynchronously) + * Execute getPullRequest 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 external principal -
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getExternalPrincipalAsync(principalId, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPullRequestAsync(repository, pullRequest, _callback); } } /** - * describe external principal by id + * get pull request * - * @param principalId (required) - * @return APIgetExternalPrincipalRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @return APIgetPullRequestRequest * @http.response.details - +
Status Code Description Response Headers
200 external principal -
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public APIgetExternalPrincipalRequest getExternalPrincipal(String principalId) { - return new APIgetExternalPrincipalRequest(principalId); + public APIgetPullRequestRequest getPullRequest(String repository, String pullRequest) { + return new APIgetPullRequestRequest(repository, pullRequest); } private okhttp3.Call hardResetBranchCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1499,12 +2063,233 @@ private okhttp3.Call hardResetBranchCall(String repository, String branch, Strin Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (ref != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ref", ref)); + if (ref != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ref", ref)); + } + + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + + 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 hardResetBranchValidateBeforeCall(String repository, String branch, String ref, Boolean force, 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 hardResetBranch(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling hardResetBranch(Async)"); + } + + // verify the required parameter 'ref' is set + if (ref == null) { + throw new ApiException("Missing the required parameter 'ref' when calling hardResetBranch(Async)"); + } + + return hardResetBranchCall(repository, branch, ref, force, _callback); + + } + + + private ApiResponse hardResetBranchWithHttpInfo(String repository, String branch, String ref, Boolean force) throws ApiException { + okhttp3.Call localVarCall = hardResetBranchValidateBeforeCall(repository, branch, ref, force, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call hardResetBranchAsync(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hardResetBranchValidateBeforeCall(repository, branch, ref, force, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIhardResetBranchRequest { + private final String repository; + private final String branch; + private final String ref; + private Boolean force; + + private APIhardResetBranchRequest(String repository, String branch, String ref) { + this.repository = repository; + this.branch = branch; + this.ref = ref; + } + + /** + * Set force + * @param force (optional, default to false) + * @return APIhardResetBranchRequest + */ + public APIhardResetBranchRequest force(Boolean force) { + this.force = force; + return this; + } + + /** + * Build call for hardResetBranch + * @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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return hardResetBranchCall(repository, branch, ref, force, _callback); + } + + /** + * Execute hardResetBranch 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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + hardResetBranchWithHttpInfo(repository, branch, ref, force); + } + + /** + * Execute hardResetBranch 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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return hardResetBranchWithHttpInfo(repository, branch, ref, force); + } + + /** + * Execute hardResetBranch 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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return hardResetBranchAsync(repository, branch, ref, force, _callback); + } + } + + /** + * hard reset branch + * Relocate branch to refer to ref. Branch must not contain uncommitted data. + * @param repository (required) + * @param branch (required) + * @param ref After reset, branch will point at this reference. (required) + * @return APIhardResetBranchRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
204 reset successful -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIhardResetBranchRequest hardResetBranch(String repository, String branch, String ref) { + return new APIhardResetBranchRequest(repository, branch, ref); + } + private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, 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}/pulls" + .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 (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (state != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); } final String[] localVarAccepts = { @@ -1523,168 +2308,179 @@ private okhttp3.Call hardResetBranchCall(String repository, String branch, Strin } 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); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call hardResetBranchValidateBeforeCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, 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 hardResetBranch(Async)"); - } - - // verify the required parameter 'branch' is set - if (branch == null) { - throw new ApiException("Missing the required parameter 'branch' when calling hardResetBranch(Async)"); - } - - // verify the required parameter 'ref' is set - if (ref == null) { - throw new ApiException("Missing the required parameter 'ref' when calling hardResetBranch(Async)"); + throw new ApiException("Missing the required parameter 'repository' when calling listPullRequests(Async)"); } - return hardResetBranchCall(repository, branch, ref, force, _callback); + return listPullRequestsCall(repository, prefix, after, amount, state, _callback); } - private ApiResponse hardResetBranchWithHttpInfo(String repository, String branch, String ref, Boolean force) throws ApiException { - okhttp3.Call localVarCall = hardResetBranchValidateBeforeCall(repository, branch, ref, force, null); - return localVarApiClient.execute(localVarCall); + private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call hardResetBranchAsync(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = hardResetBranchValidateBeforeCall(repository, branch, ref, force, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIhardResetBranchRequest { + public class APIlistPullRequestsRequest { private final String repository; - private final String branch; - private final String ref; - private Boolean force; + private String prefix; + private String after; + private Integer amount; + private String state; - private APIhardResetBranchRequest(String repository, String branch, String ref) { + private APIlistPullRequestsRequest(String repository) { this.repository = repository; - this.branch = branch; - this.ref = ref; } /** - * Set force - * @param force (optional, default to false) - * @return APIhardResetBranchRequest + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistPullRequestsRequest */ - public APIhardResetBranchRequest force(Boolean force) { - this.force = force; + public APIlistPullRequestsRequest prefix(String prefix) { + this.prefix = prefix; return this; } /** - * Build call for hardResetBranch + * Set after + * @param after return items after this value (optional) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set state + * @param state (optional, default to all) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest state(String state) { + this.state = state; + return this; + } + + /** + * Build call for listPullRequests * @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 -
400 Bad Request -
200 list of pull requests -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return hardResetBranchCall(repository, branch, ref, force, _callback); + return listPullRequestsCall(repository, prefix, after, amount, state, _callback); } /** - * Execute hardResetBranch request + * Execute listPullRequests request + * @return PullRequestsList * @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 -
400 Bad Request -
200 list of pull requests -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public void execute() throws ApiException { - hardResetBranchWithHttpInfo(repository, branch, ref, force); + public PullRequestsList execute() throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return localVarResp.getData(); } /** - * Execute hardResetBranch request with HTTP info returned - * @return ApiResponse<Void> + * Execute listPullRequests request with HTTP info returned + * @return ApiResponse<PullRequestsList> * @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 -
400 Bad Request -
200 list of pull requests -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return hardResetBranchWithHttpInfo(repository, branch, ref, force); + public ApiResponse executeWithHttpInfo() throws ApiException { + return listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); } /** - * Execute hardResetBranch request (asynchronously) + * Execute listPullRequests 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 -
400 Bad Request -
200 list of pull requests -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return hardResetBranchAsync(repository, branch, ref, force, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listPullRequestsAsync(repository, prefix, after, amount, state, _callback); } } /** - * hard reset branch - * Relocate branch to refer to ref. Branch must not contain uncommitted data. + * list pull requests + * * @param repository (required) - * @param branch (required) - * @param ref After reset, branch will point at this reference. (required) - * @return APIhardResetBranchRequest + * @return APIlistPullRequestsRequest * @http.response.details - - + -
Status Code Description Response Headers
204 reset successful -
400 Bad Request -
200 list of pull requests -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ - public APIhardResetBranchRequest hardResetBranch(String repository, String branch, String ref) { - return new APIhardResetBranchRequest(repository, branch, ref); + public APIlistPullRequestsRequest listPullRequests(String repository) { + return new APIlistPullRequestsRequest(repository); } private okhttp3.Call listUserExternalPrincipalsCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2070,4 +2866,195 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac public APIstsLoginRequest stsLogin(StsAuthRequest stsAuthRequest) { return new APIstsLoginRequest(stsAuthRequest); } + private okhttp3.Call updatePullRequestCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 = pullRequestBasic; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePullRequestValidateBeforeCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequestBasic' is set + if (pullRequestBasic == null) { + throw new ApiException("Missing the required parameter 'pullRequestBasic' when calling updatePullRequest(Async)"); + } + + return updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + + } + + + private ApiResponse updatePullRequestWithHttpInfo(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call updatePullRequestAsync(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIupdatePullRequestRequest { + private final String repository; + private final String pullRequest; + private final PullRequestBasic pullRequestBasic; + + private APIupdatePullRequestRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) { + this.repository = repository; + this.pullRequest = pullRequest; + this.pullRequestBasic = pullRequestBasic; + } + + /** + * Build call for updatePullRequest + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return updatePullRequestAsync(repository, pullRequest, pullRequestBasic, _callback); + } + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @return APIupdatePullRequestRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIupdatePullRequestRequest updatePullRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) { + return new APIupdatePullRequestRequest(repository, pullRequest, pullRequestBasic); + } } 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 index 99e478a97cf..42b02d5b208 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java @@ -158,6 +158,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.PresignMultipartUpload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PullRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PullRequestBasic.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PullRequestCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.PullRequestsList.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()); diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java new file mode 100644 index 00000000000..2d78d29db31 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java @@ -0,0 +1,1062 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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.PullRequest; +import io.lakefs.clients.sdk.model.PullRequestBasic; +import io.lakefs.clients.sdk.model.PullRequestCreation; +import io.lakefs.clients.sdk.model.PullRequestsList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PullsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PullsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PullsApi(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 createPullRequestCall(String repository, PullRequestCreation pullRequestCreation, 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 = pullRequestCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls" + .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 createPullRequestValidateBeforeCall(String repository, PullRequestCreation pullRequestCreation, 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 createPullRequest(Async)"); + } + + // verify the required parameter 'pullRequestCreation' is set + if (pullRequestCreation == null) { + throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); + } + + return createPullRequestCall(repository, pullRequestCreation, _callback); + + } + + + private ApiResponse createPullRequestWithHttpInfo(String repository, PullRequestCreation pullRequestCreation) throws ApiException { + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIcreatePullRequestRequest { + private final String repository; + private final PullRequestCreation pullRequestCreation; + + private APIcreatePullRequestRequest(String repository, PullRequestCreation pullRequestCreation) { + this.repository = repository; + this.pullRequestCreation = pullRequestCreation; + } + + /** + * Build call for createPullRequest + * @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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return createPullRequestCall(repository, pullRequestCreation, _callback); + } + + /** + * Execute createPullRequest 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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public String execute() throws ApiException { + ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + return localVarResp.getData(); + } + + /** + * Execute createPullRequest 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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createPullRequestWithHttpInfo(repository, pullRequestCreation); + } + + /** + * Execute createPullRequest 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 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createPullRequestAsync(repository, pullRequestCreation, _callback); + } + } + + /** + * create pull request + * + * @param repository (required) + * @param pullRequestCreation (required) + * @return APIcreatePullRequestRequest + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
201 pull request id -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
+ */ + public APIcreatePullRequestRequest createPullRequest(String repository, PullRequestCreation pullRequestCreation) { + return new APIcreatePullRequestRequest(repository, pullRequestCreation); + } + private okhttp3.Call deletePullRequestCall(String repository, String pullRequest, 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}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.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 deletePullRequestValidateBeforeCall(String repository, String pullRequest, 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 deletePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling deletePullRequest(Async)"); + } + + return deletePullRequestCall(repository, pullRequest, _callback); + + } + + + private ApiResponse deletePullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call deletePullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePullRequestValidateBeforeCall(repository, pullRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIdeletePullRequestRequest { + private final String repository; + private final String pullRequest; + + private APIdeletePullRequestRequest(String repository, String pullRequest) { + this.repository = repository; + this.pullRequest = pullRequest; + } + + /** + * Build call for deletePullRequest + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return deletePullRequestCall(repository, pullRequest, _callback); + } + + /** + * Execute deletePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + deletePullRequestWithHttpInfo(repository, pullRequest); + } + + /** + * Execute deletePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deletePullRequestWithHttpInfo(repository, pullRequest); + } + + /** + * Execute deletePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return deletePullRequestAsync(repository, pullRequest, _callback); + } + } + + /** + * delete pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return APIdeletePullRequestRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIdeletePullRequestRequest deletePullRequest(String repository, String pullRequest) { + return new APIdeletePullRequestRequest(repository, pullRequest); + } + private okhttp3.Call getPullRequestCall(String repository, String pullRequest, 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}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.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 getPullRequestValidateBeforeCall(String repository, String pullRequest, 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 getPullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling getPullRequest(Async)"); + } + + return getPullRequestCall(repository, pullRequest, _callback); + + } + + + private ApiResponse getPullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetPullRequestRequest { + private final String repository; + private final String pullRequest; + + private APIgetPullRequestRequest(String repository, String pullRequest) { + this.repository = repository; + this.pullRequest = pullRequest; + } + + /** + * Build call for getPullRequest + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getPullRequestCall(repository, pullRequest, _callback); + } + + /** + * Execute getPullRequest request + * @return PullRequest + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequest execute() throws ApiException { + ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); + return localVarResp.getData(); + } + + /** + * Execute getPullRequest request with HTTP info returned + * @return ApiResponse<PullRequest> + * @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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPullRequestWithHttpInfo(repository, pullRequest); + } + + /** + * Execute getPullRequest 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 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPullRequestAsync(repository, pullRequest, _callback); + } + } + + /** + * get pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @return APIgetPullRequestRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 pull request -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIgetPullRequestRequest getPullRequest(String repository, String pullRequest) { + return new APIgetPullRequestRequest(repository, pullRequest); + } + private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, 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}/pulls" + .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)); + } + + if (state != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + } + + 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 listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, 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 listPullRequests(Async)"); + } + + return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + + } + + + private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistPullRequestsRequest { + private final String repository; + private String prefix; + private String after; + private Integer amount; + private String state; + + private APIlistPullRequestsRequest(String repository) { + this.repository = repository; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Set after + * @param after return items after this value (optional) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Set state + * @param state (optional, default to all) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest state(String state) { + this.state = state; + return this; + } + + /** + * Build call for listPullRequests + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + } + + /** + * Execute listPullRequests request + * @return PullRequestsList + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public PullRequestsList execute() throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return localVarResp.getData(); + } + + /** + * Execute listPullRequests request with HTTP info returned + * @return ApiResponse<PullRequestsList> + * @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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + } + + /** + * Execute listPullRequests 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 of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listPullRequestsAsync(repository, prefix, after, amount, state, _callback); + } + } + + /** + * list pull requests + * + * @param repository (required) + * @return APIlistPullRequestsRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 list of pull requests -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIlistPullRequestsRequest listPullRequests(String repository) { + return new APIlistPullRequestsRequest(repository); + } + private okhttp3.Call updatePullRequestCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 = pullRequestBasic; + + // create path and map variables + String localVarPath = "/repositories/{repository}/pulls/{pull_request}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "pull_request" + "}", localVarApiClient.escapeString(pullRequest.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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePullRequestValidateBeforeCall(String repository, String pullRequest, PullRequestBasic pullRequestBasic, 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 updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequest' is set + if (pullRequest == null) { + throw new ApiException("Missing the required parameter 'pullRequest' when calling updatePullRequest(Async)"); + } + + // verify the required parameter 'pullRequestBasic' is set + if (pullRequestBasic == null) { + throw new ApiException("Missing the required parameter 'pullRequestBasic' when calling updatePullRequest(Async)"); + } + + return updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + + } + + + private ApiResponse updatePullRequestWithHttpInfo(String repository, String pullRequest, PullRequestBasic pullRequestBasic) throws ApiException { + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call updatePullRequestAsync(String repository, String pullRequest, PullRequestBasic pullRequestBasic, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePullRequestValidateBeforeCall(repository, pullRequest, pullRequestBasic, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APIupdatePullRequestRequest { + private final String repository; + private final String pullRequest; + private final PullRequestBasic pullRequestBasic; + + private APIupdatePullRequestRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) { + this.repository = repository; + this.pullRequest = pullRequest; + this.pullRequestBasic = pullRequestBasic; + } + + /** + * Build call for updatePullRequest + * @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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return updatePullRequestCall(repository, pullRequest, pullRequestBasic, _callback); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public void execute() throws ApiException { + updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updatePullRequestWithHttpInfo(repository, pullRequest, pullRequestBasic); + } + + /** + * Execute updatePullRequest 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 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return updatePullRequestAsync(repository, pullRequest, pullRequestBasic, _callback); + } + } + + /** + * update pull request + * + * @param repository (required) + * @param pullRequest pull request id (required) + * @param pullRequestBasic (required) + * @return APIupdatePullRequestRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 pull request deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
+ */ + public APIupdatePullRequestRequest updatePullRequest(String repository, String pullRequest, PullRequestBasic pullRequestBasic) { + return new APIupdatePullRequestRequest(repository, pullRequest, pullRequestBasic); + } +} diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequest.java new file mode 100644 index 00000000000..7a606a04097 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequest.java @@ -0,0 +1,588 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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; + +/** + * PullRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequest { + 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_AUTHOR = "author"; + @SerializedName(SERIALIZED_NAME_AUTHOR) + private String author; + + public static final String SERIALIZED_NAME_SOURCE_BRANCH = "source_branch"; + @SerializedName(SERIALIZED_NAME_SOURCE_BRANCH) + private String sourceBranch; + + public static final String SERIALIZED_NAME_DESTINATION_BRANCH = "destination_branch"; + @SerializedName(SERIALIZED_NAME_DESTINATION_BRANCH) + private String destinationBranch; + + public static final String SERIALIZED_NAME_COMMIT_ID = "commit_id"; + @SerializedName(SERIALIZED_NAME_COMMIT_ID) + private String commitId; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + CLOSED("closed"), + + MERGED("merged"); + + 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_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public PullRequest() { + } + + public PullRequest 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 PullRequest creationDate(Long creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * Get creationDate + * @return creationDate + **/ + @javax.annotation.Nonnull + public Long getCreationDate() { + return creationDate; + } + + + public void setCreationDate(Long creationDate) { + this.creationDate = creationDate; + } + + + public PullRequest author(String author) { + + this.author = author; + return this; + } + + /** + * Get author + * @return author + **/ + @javax.annotation.Nonnull + public String getAuthor() { + return author; + } + + + public void setAuthor(String author) { + this.author = author; + } + + + public PullRequest sourceBranch(String sourceBranch) { + + this.sourceBranch = sourceBranch; + return this; + } + + /** + * Get sourceBranch + * @return sourceBranch + **/ + @javax.annotation.Nonnull + public String getSourceBranch() { + return sourceBranch; + } + + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + + public PullRequest destinationBranch(String destinationBranch) { + + this.destinationBranch = destinationBranch; + return this; + } + + /** + * Get destinationBranch + * @return destinationBranch + **/ + @javax.annotation.Nonnull + public String getDestinationBranch() { + return destinationBranch; + } + + + public void setDestinationBranch(String destinationBranch) { + this.destinationBranch = destinationBranch; + } + + + public PullRequest commitId(String commitId) { + + this.commitId = commitId; + return this; + } + + /** + * the commit id of merged PRs + * @return commitId + **/ + @javax.annotation.Nullable + public String getCommitId() { + return commitId; + } + + + public void setCommitId(String commitId) { + this.commitId = commitId; + } + + + public PullRequest 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 PullRequest title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequest description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + /** + * 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 PullRequest instance itself + */ + public PullRequest 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; + } + PullRequest pullRequest = (PullRequest) o; + return Objects.equals(this.id, pullRequest.id) && + Objects.equals(this.creationDate, pullRequest.creationDate) && + Objects.equals(this.author, pullRequest.author) && + Objects.equals(this.sourceBranch, pullRequest.sourceBranch) && + Objects.equals(this.destinationBranch, pullRequest.destinationBranch) && + Objects.equals(this.commitId, pullRequest.commitId) && + Objects.equals(this.status, pullRequest.status) && + Objects.equals(this.title, pullRequest.title) && + Objects.equals(this.description, pullRequest.description)&& + Objects.equals(this.additionalProperties, pullRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, author, sourceBranch, destinationBranch, commitId, status, title, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" sourceBranch: ").append(toIndentedString(sourceBranch)).append("\n"); + sb.append(" destinationBranch: ").append(toIndentedString(destinationBranch)).append("\n"); + sb.append(" commitId: ").append(toIndentedString(commitId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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"); + openapiFields.add("title"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("creation_date"); + openapiRequiredFields.add("author"); + openapiRequiredFields.add("source_branch"); + openapiRequiredFields.add("destination_branch"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("description"); + } + + /** + * 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 PullRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PullRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PullRequest is not found in the empty JSON string", PullRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PullRequest.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("author").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `author` to be a primitive type in the JSON string but got `%s`", jsonObj.get("author").toString())); + } + if (!jsonObj.get("source_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_branch").toString())); + } + if (!jsonObj.get("destination_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination_branch").toString())); + } + if ((jsonObj.get("commit_id") != null && !jsonObj.get("commit_id").isJsonNull()) && !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())); + } + 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("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PullRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PullRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PullRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PullRequest 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 PullRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PullRequest 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 PullRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PullRequest + * @throws IOException if the JSON string is invalid with respect to PullRequest + */ + public static PullRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PullRequest.class); + } + + /** + * Convert an instance of PullRequest 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/PullRequestBasic.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestBasic.java new file mode 100644 index 00000000000..a8733f117da --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestBasic.java @@ -0,0 +1,396 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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; + +/** + * PullRequestBasic + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestBasic { + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + CLOSED("closed"), + + MERGED("merged"); + + 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_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public PullRequestBasic() { + } + + public PullRequestBasic status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public PullRequestBasic title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequestBasic description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + /** + * 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 PullRequestBasic instance itself + */ + public PullRequestBasic 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; + } + PullRequestBasic pullRequestBasic = (PullRequestBasic) o; + return Objects.equals(this.status, pullRequestBasic.status) && + Objects.equals(this.title, pullRequestBasic.title) && + Objects.equals(this.description, pullRequestBasic.description)&& + Objects.equals(this.additionalProperties, pullRequestBasic.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, title, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestBasic {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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"); + openapiFields.add("title"); + openapiFields.add("description"); + + // 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 PullRequestBasic + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PullRequestBasic.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PullRequestBasic is not found in the empty JSON string", PullRequestBasic.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !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("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PullRequestBasic.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PullRequestBasic' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PullRequestBasic.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PullRequestBasic 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 PullRequestBasic read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PullRequestBasic 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 PullRequestBasic given an JSON string + * + * @param jsonString JSON string + * @return An instance of PullRequestBasic + * @throws IOException if the JSON string is invalid with respect to PullRequestBasic + */ + public static PullRequestBasic fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PullRequestBasic.class); + } + + /** + * Convert an instance of PullRequestBasic 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/PullRequestCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestCreation.java new file mode 100644 index 00000000000..254fdb04d49 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestCreation.java @@ -0,0 +1,389 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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; + +/** + * PullRequestCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestCreation { + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_SOURCE_BRANCH = "source_branch"; + @SerializedName(SERIALIZED_NAME_SOURCE_BRANCH) + private String sourceBranch; + + public static final String SERIALIZED_NAME_DESTINATION_BRANCH = "destination_branch"; + @SerializedName(SERIALIZED_NAME_DESTINATION_BRANCH) + private String destinationBranch; + + public PullRequestCreation() { + } + + public PullRequestCreation title(String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + **/ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public PullRequestCreation description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public PullRequestCreation sourceBranch(String sourceBranch) { + + this.sourceBranch = sourceBranch; + return this; + } + + /** + * Get sourceBranch + * @return sourceBranch + **/ + @javax.annotation.Nonnull + public String getSourceBranch() { + return sourceBranch; + } + + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + + public PullRequestCreation destinationBranch(String destinationBranch) { + + this.destinationBranch = destinationBranch; + return this; + } + + /** + * Get destinationBranch + * @return destinationBranch + **/ + @javax.annotation.Nonnull + public String getDestinationBranch() { + return destinationBranch; + } + + + public void setDestinationBranch(String destinationBranch) { + this.destinationBranch = destinationBranch; + } + + /** + * 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 PullRequestCreation instance itself + */ + public PullRequestCreation 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; + } + PullRequestCreation pullRequestCreation = (PullRequestCreation) o; + return Objects.equals(this.title, pullRequestCreation.title) && + Objects.equals(this.description, pullRequestCreation.description) && + Objects.equals(this.sourceBranch, pullRequestCreation.sourceBranch) && + Objects.equals(this.destinationBranch, pullRequestCreation.destinationBranch)&& + Objects.equals(this.additionalProperties, pullRequestCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, description, sourceBranch, destinationBranch, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestCreation {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" sourceBranch: ").append(toIndentedString(sourceBranch)).append("\n"); + sb.append(" destinationBranch: ").append(toIndentedString(destinationBranch)).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("title"); + openapiFields.add("description"); + openapiFields.add("source_branch"); + openapiFields.add("destination_branch"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("source_branch"); + openapiRequiredFields.add("destination_branch"); + } + + /** + * 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 PullRequestCreation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PullRequestCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PullRequestCreation is not found in the empty JSON string", PullRequestCreation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PullRequestCreation.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("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("source_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_branch").toString())); + } + if (!jsonObj.get("destination_branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination_branch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PullRequestCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PullRequestCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PullRequestCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PullRequestCreation 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 PullRequestCreation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PullRequestCreation 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 PullRequestCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of PullRequestCreation + * @throws IOException if the JSON string is invalid with respect to PullRequestCreation + */ + public static PullRequestCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PullRequestCreation.class); + } + + /** + * Convert an instance of PullRequestCreation 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/PullRequestsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestsList.java new file mode 100644 index 00000000000..a853df4432e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PullRequestsList.java @@ -0,0 +1,343 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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.PullRequest; +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; + +/** + * PullRequestsList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PullRequestsList { + 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 PullRequestsList() { + } + + public PullRequestsList 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 PullRequestsList results(List results) { + + this.results = results; + return this; + } + + public PullRequestsList addResultsItem(PullRequest 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 PullRequestsList instance itself + */ + public PullRequestsList 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; + } + PullRequestsList pullRequestsList = (PullRequestsList) o; + return Objects.equals(this.pagination, pullRequestsList.pagination) && + Objects.equals(this.results, pullRequestsList.results)&& + Objects.equals(this.additionalProperties, pullRequestsList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestsList {\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 PullRequestsList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PullRequestsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PullRequestsList is not found in the empty JSON string", PullRequestsList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PullRequestsList.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++) { + PullRequest.validateJsonElement(jsonArrayresults.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PullRequestsList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PullRequestsList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PullRequestsList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PullRequestsList 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 PullRequestsList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PullRequestsList 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 PullRequestsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PullRequestsList + * @throws IOException if the JSON string is invalid with respect to PullRequestsList + */ + public static PullRequestsList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PullRequestsList.class); + } + + /** + * Convert an instance of PullRequestsList 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/ExperimentalApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java index 98cc07acb4b..1432e417a7b 100644 --- a/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java @@ -24,6 +24,10 @@ import io.lakefs.clients.sdk.model.ExternalPrincipalList; import io.lakefs.clients.sdk.model.ObjectStats; import io.lakefs.clients.sdk.model.PresignMultipartUpload; +import io.lakefs.clients.sdk.model.PullRequest; +import io.lakefs.clients.sdk.model.PullRequestBasic; +import io.lakefs.clients.sdk.model.PullRequestCreation; +import io.lakefs.clients.sdk.model.PullRequestsList; import io.lakefs.clients.sdk.model.StagingLocation; import io.lakefs.clients.sdk.model.StsAuthRequest; import org.junit.jupiter.api.Disabled; @@ -101,6 +105,20 @@ public void createPresignMultipartUploadTest() throws ApiException { // TODO: test validations } + /** + * create pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void createPullRequestTest() throws ApiException { + String repository = null; + PullRequestCreation pullRequestCreation = null; + String response = api.createPullRequest(repository, pullRequestCreation) + .execute(); + // TODO: test validations + } + /** * attach external principal to user * @@ -117,6 +135,20 @@ public void createUserExternalPrincipalTest() throws ApiException { // TODO: test validations } + /** + * delete pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void deletePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + api.deletePullRequest(repository, pullRequest) + .execute(); + // TODO: test validations + } + /** * delete external principal from user * @@ -158,6 +190,20 @@ public void getExternalPrincipalTest() throws ApiException { // TODO: test validations } + /** + * get pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequest response = api.getPullRequest(repository, pullRequest) + .execute(); + // TODO: test validations + } + /** * hard reset branch * @@ -177,6 +223,27 @@ public void hardResetBranchTest() throws ApiException { // TODO: test validations } + /** + * list pull requests + * + * @throws ApiException if the Api call fails + */ + @Test + public void listPullRequestsTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + String state = null; + PullRequestsList response = api.listPullRequests(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .state(state) + .execute(); + // TODO: test validations + } + /** * list user external policies attached to a user * @@ -209,4 +276,19 @@ public void stsLoginTest() throws ApiException { // TODO: test validations } + /** + * update pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequestBasic pullRequestBasic = null; + api.updatePullRequest(repository, pullRequest, pullRequestBasic) + .execute(); + // TODO: test validations + } + } diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java new file mode 100644 index 00000000000..48a35804e5a --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java @@ -0,0 +1,116 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.sdk; + +import io.lakefs.clients.sdk.ApiException; +import io.lakefs.clients.sdk.model.Error; +import io.lakefs.clients.sdk.model.PullRequest; +import io.lakefs.clients.sdk.model.PullRequestBasic; +import io.lakefs.clients.sdk.model.PullRequestCreation; +import io.lakefs.clients.sdk.model.PullRequestsList; +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 PullsApi + */ +@Disabled +public class PullsApiTest { + + private final PullsApi api = new PullsApi(); + + /** + * create pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void createPullRequestTest() throws ApiException { + String repository = null; + PullRequestCreation pullRequestCreation = null; + String response = api.createPullRequest(repository, pullRequestCreation) + .execute(); + // TODO: test validations + } + + /** + * delete pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void deletePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + api.deletePullRequest(repository, pullRequest) + .execute(); + // TODO: test validations + } + + /** + * get pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequest response = api.getPullRequest(repository, pullRequest) + .execute(); + // TODO: test validations + } + + /** + * list pull requests + * + * @throws ApiException if the Api call fails + */ + @Test + public void listPullRequestsTest() throws ApiException { + String repository = null; + String prefix = null; + String after = null; + Integer amount = null; + String state = null; + PullRequestsList response = api.listPullRequests(repository) + .prefix(prefix) + .after(after) + .amount(amount) + .state(state) + .execute(); + // TODO: test validations + } + + /** + * update pull request + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePullRequestTest() throws ApiException { + String repository = null; + String pullRequest = null; + PullRequestBasic pullRequestBasic = null; + api.updatePullRequest(repository, pullRequest, pullRequestBasic) + .execute(); + // TODO: test validations + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestBasicTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestBasicTest.java new file mode 100644 index 00000000000..c17e16ebbe6 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestBasicTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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 PullRequestBasic + */ +public class PullRequestBasicTest { + private final PullRequestBasic model = new PullRequestBasic(); + + /** + * Model tests for PullRequestBasic + */ + @Test + public void testPullRequestBasic() { + // TODO: test PullRequestBasic + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestCreationTest.java new file mode 100644 index 00000000000..8ce95e337cc --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestCreationTest.java @@ -0,0 +1,72 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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 PullRequestCreation + */ +public class PullRequestCreationTest { + private final PullRequestCreation model = new PullRequestCreation(); + + /** + * Model tests for PullRequestCreation + */ + @Test + public void testPullRequestCreation() { + // TODO: test PullRequestCreation + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'sourceBranch' + */ + @Test + public void sourceBranchTest() { + // TODO: test sourceBranch + } + + /** + * Test the property 'destinationBranch' + */ + @Test + public void destinationBranchTest() { + // TODO: test destinationBranch + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestTest.java new file mode 100644 index 00000000000..c0a6523d65f --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestTest.java @@ -0,0 +1,64 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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 PullRequest + */ +public class PullRequestTest { + private final PullRequest model = new PullRequest(); + + /** + * Model tests for PullRequest + */ + @Test + public void testPullRequest() { + // TODO: test PullRequest + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestsListTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestsListTest.java new file mode 100644 index 00000000000..911d332c0fa --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/PullRequestsListTest.java @@ -0,0 +1,60 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.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.PullRequest; +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 PullRequestsList + */ +public class PullRequestsListTest { + private final PullRequestsList model = new PullRequestsList(); + + /** + * Model tests for PullRequestsList + */ + @Test + public void testPullRequestsList() { + // TODO: test PullRequestsList + } + + /** + * 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/python-legacy/.openapi-generator/FILES b/clients/python-legacy/.openapi-generator/FILES index a25b2426bec..30e7d6e2dc0 100644 --- a/clients/python-legacy/.openapi-generator/FILES +++ b/clients/python-legacy/.openapi-generator/FILES @@ -82,6 +82,11 @@ docs/PolicyList.md docs/PrepareGCUncommittedRequest.md docs/PrepareGCUncommittedResponse.md docs/PresignMultipartUpload.md +docs/PullRequest.md +docs/PullRequestBasic.md +docs/PullRequestCreation.md +docs/PullRequestsList.md +docs/PullsApi.md docs/RangeMetadata.md docs/Ref.md docs/RefList.md @@ -136,6 +141,7 @@ lakefs_client/api/import_api.py lakefs_client/api/internal_api.py lakefs_client/api/metadata_api.py lakefs_client/api/objects_api.py +lakefs_client/api/pulls_api.py lakefs_client/api/refs_api.py lakefs_client/api/repositories_api.py lakefs_client/api/staging_api.py @@ -214,6 +220,10 @@ lakefs_client/model/policy_list.py lakefs_client/model/prepare_gc_uncommitted_request.py lakefs_client/model/prepare_gc_uncommitted_response.py lakefs_client/model/presign_multipart_upload.py +lakefs_client/model/pull_request.py +lakefs_client/model/pull_request_basic.py +lakefs_client/model/pull_request_creation.py +lakefs_client/model/pull_requests_list.py lakefs_client/model/range_metadata.py lakefs_client/model/ref.py lakefs_client/model/ref_list.py @@ -337,6 +347,11 @@ test/test_policy_list.py test/test_prepare_gc_uncommitted_request.py test/test_prepare_gc_uncommitted_response.py test/test_presign_multipart_upload.py +test/test_pull_request.py +test/test_pull_request_basic.py +test/test_pull_request_creation.py +test/test_pull_requests_list.py +test/test_pulls_api.py test/test_range_metadata.py test/test_ref.py test/test_ref_list.py diff --git a/clients/python-legacy/README.md b/clients/python-legacy/README.md index be305f56843..1fb7dc3861b 100644 --- a/clients/python-legacy/README.md +++ b/clients/python-legacy/README.md @@ -170,13 +170,18 @@ Class | Method | HTTP request | Description *ExperimentalApi* | [**abort_presign_multipart_upload**](docs/ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload *ExperimentalApi* | [**complete_presign_multipart_upload**](docs/ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request *ExperimentalApi* | [**create_presign_multipart_upload**](docs/ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +*ExperimentalApi* | [**create_pull_request**](docs/ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request *ExperimentalApi* | [**create_user_external_principal**](docs/ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +*ExperimentalApi* | [**delete_pull_request**](docs/ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request *ExperimentalApi* | [**delete_user_external_principal**](docs/ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExperimentalApi* | [**external_principal_login**](docs/ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator *ExperimentalApi* | [**get_external_principal**](docs/ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +*ExperimentalApi* | [**get_pull_request**](docs/ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request *ExperimentalApi* | [**hard_reset_branch**](docs/ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +*ExperimentalApi* | [**list_pull_requests**](docs/ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests *ExperimentalApi* | [**list_user_external_principals**](docs/ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user *ExperimentalApi* | [**sts_login**](docs/ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +*ExperimentalApi* | [**update_pull_request**](docs/ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *ExternalApi* | [**create_user_external_principal**](docs/ExternalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user *ExternalApi* | [**delete_user_external_principal**](docs/ExternalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExternalApi* | [**external_principal_login**](docs/ExternalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator @@ -225,6 +230,11 @@ Class | Method | HTTP request | Description *ObjectsApi* | [**list_objects**](docs/ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix *ObjectsApi* | [**stat_object**](docs/ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata *ObjectsApi* | [**upload_object**](docs/ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | +*PullsApi* | [**create_pull_request**](docs/PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +*PullsApi* | [**delete_pull_request**](docs/PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +*PullsApi* | [**get_pull_request**](docs/PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +*PullsApi* | [**list_pull_requests**](docs/PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +*PullsApi* | [**update_pull_request**](docs/PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *RefsApi* | [**diff_refs**](docs/RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references *RefsApi* | [**find_merge_base**](docs/RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references *RefsApi* | [**log_commits**](docs/RefsApi.md#log_commits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. @@ -321,6 +331,10 @@ Class | Method | HTTP request | Description - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) - [PresignMultipartUpload](docs/PresignMultipartUpload.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestBasic](docs/PullRequestBasic.md) + - [PullRequestCreation](docs/PullRequestCreation.md) + - [PullRequestsList](docs/PullRequestsList.md) - [RangeMetadata](docs/RangeMetadata.md) - [Ref](docs/Ref.md) - [RefList](docs/RefList.md) diff --git a/clients/python-legacy/docs/ExperimentalApi.md b/clients/python-legacy/docs/ExperimentalApi.md index 240343328b3..f6d8c916990 100644 --- a/clients/python-legacy/docs/ExperimentalApi.md +++ b/clients/python-legacy/docs/ExperimentalApi.md @@ -7,13 +7,18 @@ Method | HTTP request | Description [**abort_presign_multipart_upload**](ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload [**complete_presign_multipart_upload**](ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request [**create_presign_multipart_upload**](ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +[**create_pull_request**](ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request [**create_user_external_principal**](ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +[**delete_pull_request**](ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request [**delete_user_external_principal**](ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user [**external_principal_login**](ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator [**get_external_principal**](ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +[**get_pull_request**](ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request [**hard_reset_branch**](ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +[**list_pull_requests**](ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests [**list_user_external_principals**](ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user [**sts_login**](ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +[**update_pull_request**](ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request # **abort_presign_multipart_upload** @@ -413,6 +418,124 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_pull_request** +> str create_pull_request(repository, pull_request_creation) + +create pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import experimental_api +from lakefs_client.model.pull_request_creation import PullRequestCreation +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = experimental_api.ExperimentalApi(api_client) + repository = "repository_example" # str | + pull_request_creation = PullRequestCreation( + title="title_example", + description="description_example", + source_branch="source_branch_example", + destination_branch="destination_branch_example", + ) # PullRequestCreation | + + # example passing only required values which don't have defaults set + try: + # create pull request + api_response = api_instance.create_pull_request(repository, pull_request_creation) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->create_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md)| | + +### Return type + +**str** + +### 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** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_user_external_principal** > create_user_external_principal(user_id, principal_id) @@ -539,6 +662,115 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_pull_request** +> delete_pull_request(repository, pull_request) + +delete pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import experimental_api +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = experimental_api.ExperimentalApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + + # example passing only required values which don't have defaults set + try: + # delete pull request + api_instance.delete_pull_request(repository, pull_request) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->delete_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +void (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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_user_external_principal** > delete_user_external_principal(user_id, principal_id) @@ -832,6 +1064,116 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_pull_request** +> PullRequest get_pull_request(repository, pull_request) + +get pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import experimental_api +from lakefs_client.model.pull_request import PullRequest +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = experimental_api.ExperimentalApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + + # example passing only required values which don't have defaults set + try: + # get pull request + api_response = api_instance.get_pull_request(repository, pull_request) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->get_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.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** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **hard_reset_branch** > hard_reset_branch(repository, branch, ref) @@ -956,6 +1298,131 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_pull_requests** +> PullRequestsList list_pull_requests(repository) + +list pull requests + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import experimental_api +from lakefs_client.model.pull_requests_list import PullRequestsList +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = experimental_api.ExperimentalApi(api_client) + repository = "repository_example" # str | + prefix = "prefix_example" # str | return items prefixed with this value (optional) + after = "after_example" # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 + state = "all" # str | (optional) if omitted the server will use the default value of "all" + + # example passing only required values which don't have defaults set + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->list_pull_requests: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->list_pull_requests: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **prefix** | **str**| return items prefixed with this value | [optional] + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 + **state** | **str**| | [optional] if omitted the server will use the default value of "all" + +### Return type + +[**PullRequestsList**](PullRequestsList.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 of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_user_external_principals** > ExternalPrincipalList list_user_external_principals(user_id) @@ -1154,3 +1621,119 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_pull_request** +> update_pull_request(repository, pull_request, pull_request_basic) + +update pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import experimental_api +from lakefs_client.model.error import Error +from lakefs_client.model.pull_request_basic import PullRequestBasic +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = experimental_api.ExperimentalApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + pull_request_basic = PullRequestBasic( + status="open", + title="title_example", + description="description_example", + ) # PullRequestBasic | + + # example passing only required values which don't have defaults set + try: + # update pull request + api_instance.update_pull_request(repository, pull_request, pull_request_basic) + except lakefs_client.ApiException as e: + print("Exception when calling ExperimentalApi->update_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + **pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md)| | + +### Return type + +void (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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/python-legacy/docs/PullRequest.md b/clients/python-legacy/docs/PullRequest.md new file mode 100644 index 00000000000..7f2cb2ad5f3 --- /dev/null +++ b/clients/python-legacy/docs/PullRequest.md @@ -0,0 +1,20 @@ +# PullRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**creation_date** | **int** | | +**author** | **str** | | +**source_branch** | **str** | | +**destination_branch** | **str** | | +**status** | **str** | | +**title** | **str** | | +**description** | **str** | | +**commit_id** | **str** | the commit id of merged PRs | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python-legacy/docs/PullRequestBasic.md b/clients/python-legacy/docs/PullRequestBasic.md new file mode 100644 index 00000000000..0b60180d616 --- /dev/null +++ b/clients/python-legacy/docs/PullRequestBasic.md @@ -0,0 +1,14 @@ +# PullRequestBasic + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | [optional] +**title** | **str** | | [optional] +**description** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python-legacy/docs/PullRequestCreation.md b/clients/python-legacy/docs/PullRequestCreation.md new file mode 100644 index 00000000000..d09051c54fd --- /dev/null +++ b/clients/python-legacy/docs/PullRequestCreation.md @@ -0,0 +1,15 @@ +# PullRequestCreation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**description** | **str** | | +**source_branch** | **str** | | +**destination_branch** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python-legacy/docs/PullRequestsList.md b/clients/python-legacy/docs/PullRequestsList.md new file mode 100644 index 00000000000..eb78a898c6d --- /dev/null +++ b/clients/python-legacy/docs/PullRequestsList.md @@ -0,0 +1,13 @@ +# PullRequestsList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**[PullRequest]**](PullRequest.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python-legacy/docs/PullsApi.md b/clients/python-legacy/docs/PullsApi.md new file mode 100644 index 00000000000..5c1054c058b --- /dev/null +++ b/clients/python-legacy/docs/PullsApi.md @@ -0,0 +1,591 @@ +# lakefs_client.PullsApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_pull_request**](PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +[**delete_pull_request**](PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +[**get_pull_request**](PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +[**list_pull_requests**](PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +[**update_pull_request**](PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request + + +# **create_pull_request** +> str create_pull_request(repository, pull_request_creation) + +create pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import pulls_api +from lakefs_client.model.pull_request_creation import PullRequestCreation +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pulls_api.PullsApi(api_client) + repository = "repository_example" # str | + pull_request_creation = PullRequestCreation( + title="title_example", + description="description_example", + source_branch="source_branch_example", + destination_branch="destination_branch_example", + ) # PullRequestCreation | + + # example passing only required values which don't have defaults set + try: + # create pull request + api_response = api_instance.create_pull_request(repository, pull_request_creation) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->create_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md)| | + +### Return type + +**str** + +### 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** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pull_request** +> delete_pull_request(repository, pull_request) + +delete pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import pulls_api +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pulls_api.PullsApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + + # example passing only required values which don't have defaults set + try: + # delete pull request + api_instance.delete_pull_request(repository, pull_request) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->delete_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +void (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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pull_request** +> PullRequest get_pull_request(repository, pull_request) + +get pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import pulls_api +from lakefs_client.model.pull_request import PullRequest +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pulls_api.PullsApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + + # example passing only required values which don't have defaults set + try: + # get pull request + api_response = api_instance.get_pull_request(repository, pull_request) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->get_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.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** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_pull_requests** +> PullRequestsList list_pull_requests(repository) + +list pull requests + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import pulls_api +from lakefs_client.model.pull_requests_list import PullRequestsList +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pulls_api.PullsApi(api_client) + repository = "repository_example" # str | + prefix = "prefix_example" # str | return items prefixed with this value (optional) + after = "after_example" # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 + state = "all" # str | (optional) if omitted the server will use the default value of "all" + + # example passing only required values which don't have defaults set + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->list_pull_requests: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->list_pull_requests: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **prefix** | **str**| return items prefixed with this value | [optional] + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 + **state** | **str**| | [optional] if omitted the server will use the default value of "all" + +### Return type + +[**PullRequestsList**](PullRequestsList.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 of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pull_request** +> update_pull_request(repository, pull_request, pull_request_basic) + +update pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import pulls_api +from lakefs_client.model.error import Error +from lakefs_client.model.pull_request_basic import PullRequestBasic +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pulls_api.PullsApi(api_client) + repository = "repository_example" # str | + pull_request = "pull_request_example" # str | pull request id + pull_request_basic = PullRequestBasic( + status="open", + title="title_example", + description="description_example", + ) # PullRequestBasic | + + # example passing only required values which don't have defaults set + try: + # update pull request + api_instance.update_pull_request(repository, pull_request, pull_request_basic) + except lakefs_client.ApiException as e: + print("Exception when calling PullsApi->update_pull_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + **pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md)| | + +### Return type + +void (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** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/python-legacy/lakefs_client/api/experimental_api.py b/clients/python-legacy/lakefs_client/api/experimental_api.py index 0b30ed08bc4..3e5b7221f7f 100644 --- a/clients/python-legacy/lakefs_client/api/experimental_api.py +++ b/clients/python-legacy/lakefs_client/api/experimental_api.py @@ -32,6 +32,10 @@ from lakefs_client.model.external_principal_list import ExternalPrincipalList from lakefs_client.model.object_stats import ObjectStats from lakefs_client.model.presign_multipart_upload import PresignMultipartUpload +from lakefs_client.model.pull_request import PullRequest +from lakefs_client.model.pull_request_basic import PullRequestBasic +from lakefs_client.model.pull_request_creation import PullRequestCreation +from lakefs_client.model.pull_requests_list import PullRequestsList from lakefs_client.model.staging_location import StagingLocation from lakefs_client.model.sts_auth_request import StsAuthRequest @@ -277,6 +281,69 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': (str,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls', + 'operation_id': 'create_pull_request', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request_creation', + ], + 'required': [ + 'repository', + 'pull_request_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request_creation': + (PullRequestCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + }, + 'location_map': { + 'repository': 'path', + 'pull_request_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'text/html', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.create_user_external_principal_endpoint = _Endpoint( settings={ 'response_type': None, @@ -344,6 +411,67 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.delete_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'delete_pull_request', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + ], + 'required': [ + 'repository', + 'pull_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.delete_user_external_principal_endpoint = _Endpoint( settings={ 'response_type': None, @@ -508,6 +636,67 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.get_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': (PullRequest,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'get_pull_request', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + ], + 'required': [ + 'repository', + 'pull_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.hard_reset_branch_endpoint = _Endpoint( settings={ 'response_type': None, @@ -580,6 +769,94 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.list_pull_requests_endpoint = _Endpoint( + settings={ + 'response_type': (PullRequestsList,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls', + 'operation_id': 'list_pull_requests', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'prefix', + 'after', + 'amount', + 'state', + ], + 'required': [ + 'repository', + ], + 'nullable': [ + ], + 'enum': [ + 'state', + ], + 'validation': [ + 'amount', + ] + }, + root_map={ + 'validations': { + ('amount',): { + + 'inclusive_maximum': 1000, + 'inclusive_minimum': -1, + }, + }, + 'allowed_values': { + ('state',): { + + "OPEN": "open", + "CLOSED": "closed", + "ALL": "all" + }, + }, + 'openapi_types': { + 'repository': + (str,), + 'prefix': + (str,), + 'after': + (str,), + 'amount': + (int,), + 'state': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'prefix': 'prefix', + 'after': 'after', + 'amount': 'amount', + 'state': 'state', + }, + 'location_map': { + 'repository': 'path', + 'prefix': 'query', + 'after': 'query', + 'amount': 'query', + 'state': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.list_user_external_principals_endpoint = _Endpoint( settings={ 'response_type': (ExternalPrincipalList,), @@ -706,32 +983,327 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.update_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'update_pull_request', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + 'pull_request_basic', + ], + 'required': [ + 'repository', + 'pull_request', + 'pull_request_basic', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + 'pull_request_basic': + (PullRequestBasic,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + 'pull_request_basic': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def abort_presign_multipart_upload( + self, + repository, + branch, + upload_id, + path, + **kwargs + ): + """Abort a presign multipart upload # noqa: E501 + + Aborts a presign multipart upload. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.abort_presign_multipart_upload(repository, branch, upload_id, path, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + upload_id (str): + path (str): relative to the branch + + Keyword Args: + abort_presign_multipart_upload (AbortPresignMultipartUpload): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['upload_id'] = \ + upload_id + kwargs['path'] = \ + path + return self.abort_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) + + def complete_presign_multipart_upload( + self, + repository, + branch, + upload_id, + path, + **kwargs + ): + """Complete a presign multipart upload request # noqa: E501 + + Completes a presign multipart upload by assembling the uploaded parts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.complete_presign_multipart_upload(repository, branch, upload_id, path, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + upload_id (str): + path (str): relative to the branch + + Keyword Args: + complete_presign_multipart_upload (CompletePresignMultipartUpload): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectStats + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['upload_id'] = \ + upload_id + kwargs['path'] = \ + path + return self.complete_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) + + def create_presign_multipart_upload( + self, + repository, + branch, + path, + **kwargs + ): + """Initiate a multipart upload # noqa: E501 + + Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_presign_multipart_upload(repository, branch, path, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + path (str): relative to the branch + + Keyword Args: + parts (int): number of presigned URL parts required to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PresignMultipartUpload + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['path'] = \ + path + return self.create_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) - def abort_presign_multipart_upload( + def create_pull_request( self, repository, - branch, - upload_id, - path, + pull_request_creation, **kwargs ): - """Abort a presign multipart upload # noqa: E501 + """create pull request # noqa: E501 - Aborts a presign multipart upload. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.abort_presign_multipart_upload(repository, branch, upload_id, path, async_req=True) + >>> thread = api.create_pull_request(repository, pull_request_creation, async_req=True) >>> result = thread.get() Args: repository (str): - branch (str): - upload_id (str): - path (str): relative to the branch + pull_request_creation (PullRequestCreation): Keyword Args: - abort_presign_multipart_upload (AbortPresignMultipartUpload): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -753,7 +1325,7 @@ def abort_presign_multipart_upload( async_req (bool): execute request asynchronously Returns: - None + str If the method is called asynchronously, returns the request thread. """ @@ -778,39 +1350,30 @@ def abort_presign_multipart_upload( kwargs['_host_index'] = kwargs.get('_host_index') kwargs['repository'] = \ repository - kwargs['branch'] = \ - branch - kwargs['upload_id'] = \ - upload_id - kwargs['path'] = \ - path - return self.abort_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) + kwargs['pull_request_creation'] = \ + pull_request_creation + return self.create_pull_request_endpoint.call_with_http_info(**kwargs) - def complete_presign_multipart_upload( + def create_user_external_principal( self, - repository, - branch, - upload_id, - path, + user_id, + principal_id, **kwargs ): - """Complete a presign multipart upload request # noqa: E501 + """attach external principal to user # noqa: E501 - Completes a presign multipart upload by assembling the uploaded parts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.complete_presign_multipart_upload(repository, branch, upload_id, path, async_req=True) + >>> thread = api.create_user_external_principal(user_id, principal_id, async_req=True) >>> result = thread.get() Args: - repository (str): - branch (str): - upload_id (str): - path (str): relative to the branch + user_id (str): + principal_id (str): Keyword Args: - complete_presign_multipart_upload (CompletePresignMultipartUpload): [optional] + external_principal_creation (ExternalPrincipalCreation): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -832,7 +1395,7 @@ def complete_presign_multipart_upload( async_req (bool): execute request asynchronously Returns: - ObjectStats + None If the method is called asynchronously, returns the request thread. """ @@ -855,39 +1418,31 @@ def complete_presign_multipart_upload( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - kwargs['upload_id'] = \ - upload_id - kwargs['path'] = \ - path - return self.complete_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) + kwargs['user_id'] = \ + user_id + kwargs['principal_id'] = \ + principal_id + return self.create_user_external_principal_endpoint.call_with_http_info(**kwargs) - def create_presign_multipart_upload( + def delete_pull_request( self, repository, - branch, - path, + pull_request, **kwargs ): - """Initiate a multipart upload # noqa: E501 + """delete pull request # noqa: E501 - Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_presign_multipart_upload(repository, branch, path, async_req=True) + >>> thread = api.delete_pull_request(repository, pull_request, async_req=True) >>> result = thread.get() Args: repository (str): - branch (str): - path (str): relative to the branch + pull_request (str): pull request id Keyword Args: - parts (int): number of presigned URL parts required to upload. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -909,7 +1464,7 @@ def create_presign_multipart_upload( async_req (bool): execute request asynchronously Returns: - PresignMultipartUpload + None If the method is called asynchronously, returns the request thread. """ @@ -934,24 +1489,22 @@ def create_presign_multipart_upload( kwargs['_host_index'] = kwargs.get('_host_index') kwargs['repository'] = \ repository - kwargs['branch'] = \ - branch - kwargs['path'] = \ - path - return self.create_presign_multipart_upload_endpoint.call_with_http_info(**kwargs) + kwargs['pull_request'] = \ + pull_request + return self.delete_pull_request_endpoint.call_with_http_info(**kwargs) - def create_user_external_principal( + def delete_user_external_principal( self, user_id, principal_id, **kwargs ): - """attach external principal to user # noqa: E501 + """delete external principal from user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_external_principal(user_id, principal_id, async_req=True) + >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) >>> result = thread.get() Args: @@ -959,7 +1512,6 @@ def create_user_external_principal( principal_id (str): Keyword Args: - external_principal_creation (ExternalPrincipalCreation): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -1008,27 +1560,23 @@ def create_user_external_principal( user_id kwargs['principal_id'] = \ principal_id - return self.create_user_external_principal_endpoint.call_with_http_info(**kwargs) + return self.delete_user_external_principal_endpoint.call_with_http_info(**kwargs) - def delete_user_external_principal( + def external_principal_login( self, - user_id, - principal_id, **kwargs ): - """delete external principal from user # noqa: E501 + """perform a login using an external authenticator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) + >>> thread = api.external_principal_login(async_req=True) >>> result = thread.get() - Args: - user_id (str): - principal_id (str): Keyword Args: + external_login_information (ExternalLoginInformation): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -1050,7 +1598,7 @@ def delete_user_external_principal( async_req (bool): execute request asynchronously Returns: - None + AuthenticationToken If the method is called asynchronously, returns the request thread. """ @@ -1073,27 +1621,25 @@ def delete_user_external_principal( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_id'] = \ - user_id - kwargs['principal_id'] = \ - principal_id - return self.delete_user_external_principal_endpoint.call_with_http_info(**kwargs) + return self.external_principal_login_endpoint.call_with_http_info(**kwargs) - def external_principal_login( + def get_external_principal( self, + principal_id, **kwargs ): - """perform a login using an external authenticator # noqa: E501 + """describe external principal by id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login(async_req=True) + >>> thread = api.get_external_principal(principal_id, async_req=True) >>> result = thread.get() + Args: + principal_id (str): Keyword Args: - external_login_information (ExternalLoginInformation): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -1115,7 +1661,7 @@ def external_principal_login( async_req (bool): execute request asynchronously Returns: - AuthenticationToken + ExternalPrincipal If the method is called asynchronously, returns the request thread. """ @@ -1138,23 +1684,27 @@ def external_principal_login( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - return self.external_principal_login_endpoint.call_with_http_info(**kwargs) + kwargs['principal_id'] = \ + principal_id + return self.get_external_principal_endpoint.call_with_http_info(**kwargs) - def get_external_principal( + def get_pull_request( self, - principal_id, + repository, + pull_request, **kwargs ): - """describe external principal by id # noqa: E501 + """get pull request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal(principal_id, async_req=True) + >>> thread = api.get_pull_request(repository, pull_request, async_req=True) >>> result = thread.get() Args: - principal_id (str): + repository (str): + pull_request (str): pull request id Keyword Args: _return_http_data_only (bool): response data without head status @@ -1178,7 +1728,7 @@ def get_external_principal( async_req (bool): execute request asynchronously Returns: - ExternalPrincipal + PullRequest If the method is called asynchronously, returns the request thread. """ @@ -1201,9 +1751,11 @@ def get_external_principal( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['principal_id'] = \ - principal_id - return self.get_external_principal_endpoint.call_with_http_info(**kwargs) + kwargs['repository'] = \ + repository + kwargs['pull_request'] = \ + pull_request + return self.get_pull_request_endpoint.call_with_http_info(**kwargs) def hard_reset_branch( self, @@ -1280,6 +1832,75 @@ def hard_reset_branch( ref return self.hard_reset_branch_endpoint.call_with_http_info(**kwargs) + def list_pull_requests( + self, + repository, + **kwargs + ): + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests(repository, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + + Keyword Args: + prefix (str): return items prefixed with this value. [optional] + after (str): return items after this value. [optional] + amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 + state (str): [optional] if omitted the server will use the default value of "all" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PullRequestsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + return self.list_pull_requests_endpoint.call_with_http_info(**kwargs) + def list_user_external_principals( self, user_id, @@ -1413,3 +2034,76 @@ def sts_login( sts_auth_request return self.sts_login_endpoint.call_with_http_info(**kwargs) + def update_pull_request( + self, + repository, + pull_request, + pull_request_basic, + **kwargs + ): + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + pull_request (str): pull request id + pull_request_basic (PullRequestBasic): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['pull_request'] = \ + pull_request + kwargs['pull_request_basic'] = \ + pull_request_basic + return self.update_pull_request_endpoint.call_with_http_info(**kwargs) + diff --git a/clients/python-legacy/lakefs_client/api/pulls_api.py b/clients/python-legacy/lakefs_client/api/pulls_api.py new file mode 100644 index 00000000000..48971a198eb --- /dev/null +++ b/clients/python-legacy/lakefs_client/api/pulls_api.py @@ -0,0 +1,733 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint +from lakefs_client.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from lakefs_client.model.error import Error +from lakefs_client.model.pull_request import PullRequest +from lakefs_client.model.pull_request_basic import PullRequestBasic +from lakefs_client.model.pull_request_creation import PullRequestCreation +from lakefs_client.model.pull_requests_list import PullRequestsList + + +class PullsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.create_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': (str,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls', + 'operation_id': 'create_pull_request', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request_creation', + ], + 'required': [ + 'repository', + 'pull_request_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request_creation': + (PullRequestCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + }, + 'location_map': { + 'repository': 'path', + 'pull_request_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'text/html', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.delete_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'delete_pull_request', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + ], + 'required': [ + 'repository', + 'pull_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': (PullRequest,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'get_pull_request', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + ], + 'required': [ + 'repository', + 'pull_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.list_pull_requests_endpoint = _Endpoint( + settings={ + 'response_type': (PullRequestsList,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls', + 'operation_id': 'list_pull_requests', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'prefix', + 'after', + 'amount', + 'state', + ], + 'required': [ + 'repository', + ], + 'nullable': [ + ], + 'enum': [ + 'state', + ], + 'validation': [ + 'amount', + ] + }, + root_map={ + 'validations': { + ('amount',): { + + 'inclusive_maximum': 1000, + 'inclusive_minimum': -1, + }, + }, + 'allowed_values': { + ('state',): { + + "OPEN": "open", + "CLOSED": "closed", + "ALL": "all" + }, + }, + 'openapi_types': { + 'repository': + (str,), + 'prefix': + (str,), + 'after': + (str,), + 'amount': + (int,), + 'state': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'prefix': 'prefix', + 'after': 'after', + 'amount': 'amount', + 'state': 'state', + }, + 'location_map': { + 'repository': 'path', + 'prefix': 'query', + 'after': 'query', + 'amount': 'query', + 'state': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.update_pull_request_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/pulls/{pull_request}', + 'operation_id': 'update_pull_request', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'pull_request', + 'pull_request_basic', + ], + 'required': [ + 'repository', + 'pull_request', + 'pull_request_basic', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'pull_request': + (str,), + 'pull_request_basic': + (PullRequestBasic,), + }, + 'attribute_map': { + 'repository': 'repository', + 'pull_request': 'pull_request', + }, + 'location_map': { + 'repository': 'path', + 'pull_request': 'path', + 'pull_request_basic': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def create_pull_request( + self, + repository, + pull_request_creation, + **kwargs + ): + """create pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_pull_request(repository, pull_request_creation, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + pull_request_creation (PullRequestCreation): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['pull_request_creation'] = \ + pull_request_creation + return self.create_pull_request_endpoint.call_with_http_info(**kwargs) + + def delete_pull_request( + self, + repository, + pull_request, + **kwargs + ): + """delete pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pull_request(repository, pull_request, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + pull_request (str): pull request id + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['pull_request'] = \ + pull_request + return self.delete_pull_request_endpoint.call_with_http_info(**kwargs) + + def get_pull_request( + self, + repository, + pull_request, + **kwargs + ): + """get pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pull_request(repository, pull_request, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + pull_request (str): pull request id + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PullRequest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['pull_request'] = \ + pull_request + return self.get_pull_request_endpoint.call_with_http_info(**kwargs) + + def list_pull_requests( + self, + repository, + **kwargs + ): + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests(repository, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + + Keyword Args: + prefix (str): return items prefixed with this value. [optional] + after (str): return items after this value. [optional] + amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 + state (str): [optional] if omitted the server will use the default value of "all" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PullRequestsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + return self.list_pull_requests_endpoint.call_with_http_info(**kwargs) + + def update_pull_request( + self, + repository, + pull_request, + pull_request_basic, + **kwargs + ): + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + pull_request (str): pull request id + pull_request_basic (PullRequestBasic): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['pull_request'] = \ + pull_request + kwargs['pull_request_basic'] = \ + pull_request_basic + return self.update_pull_request_endpoint.call_with_http_info(**kwargs) + diff --git a/clients/python-legacy/lakefs_client/apis/__init__.py b/clients/python-legacy/lakefs_client/apis/__init__.py index 8641847c8c3..bde8cf3b71a 100644 --- a/clients/python-legacy/lakefs_client/apis/__init__.py +++ b/clients/python-legacy/lakefs_client/apis/__init__.py @@ -26,6 +26,7 @@ from lakefs_client.api.internal_api import InternalApi from lakefs_client.api.metadata_api import MetadataApi from lakefs_client.api.objects_api import ObjectsApi +from lakefs_client.api.pulls_api import PullsApi from lakefs_client.api.refs_api import RefsApi from lakefs_client.api.repositories_api import RepositoriesApi from lakefs_client.api.staging_api import StagingApi diff --git a/clients/python-legacy/lakefs_client/client.py b/clients/python-legacy/lakefs_client/client.py index 6a0eed7e23f..ad435dd3572 100644 --- a/clients/python-legacy/lakefs_client/client.py +++ b/clients/python-legacy/lakefs_client/client.py @@ -15,6 +15,7 @@ from lakefs_client.api import internal_api from lakefs_client.api import metadata_api from lakefs_client.api import objects_api +from lakefs_client.api import pulls_api from lakefs_client.api import refs_api from lakefs_client.api import repositories_api from lakefs_client.api import staging_api @@ -56,6 +57,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.internal_api = internal_api.InternalApi(self._api) self.metadata_api = metadata_api.MetadataApi(self._api) self.objects_api = objects_api.ObjectsApi(self._api) + self.pulls_api = pulls_api.PullsApi(self._api) self.refs_api = refs_api.RefsApi(self._api) self.repositories_api = repositories_api.RepositoriesApi(self._api) self.staging_api = staging_api.StagingApi(self._api) diff --git a/clients/python-legacy/lakefs_client/model/pull_request.py b/clients/python-legacy/lakefs_client/model/pull_request.py new file mode 100644 index 00000000000..f931e05a274 --- /dev/null +++ b/clients/python-legacy/lakefs_client/model/pull_request.py @@ -0,0 +1,349 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from lakefs_client.exceptions import ApiAttributeError + + +def lazy_import(): + from lakefs_client.model.pull_request_basic import PullRequestBasic + globals()['PullRequestBasic'] = PullRequestBasic + + +class PullRequest(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'OPEN': "open", + 'CLOSED': "closed", + 'MERGED': "merged", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'creation_date': (int,), # noqa: E501 + 'author': (str,), # noqa: E501 + 'source_branch': (str,), # noqa: E501 + 'destination_branch': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'title': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'commit_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'creation_date': 'creation_date', # noqa: E501 + 'author': 'author', # noqa: E501 + 'source_branch': 'source_branch', # noqa: E501 + 'destination_branch': 'destination_branch', # noqa: E501 + 'status': 'status', # noqa: E501 + 'title': 'title', # noqa: E501 + 'description': 'description', # noqa: E501 + 'commit_id': 'commit_id', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PullRequest - a model defined in OpenAPI + + Keyword Args: + id (str): + creation_date (int): + author (str): + source_branch (str): + destination_branch (str): + status (str): + title (str): + description (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + commit_id (str): the commit id of merged PRs. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PullRequest - a model defined in OpenAPI + + Keyword Args: + id (str): + creation_date (int): + author (str): + source_branch (str): + destination_branch (str): + status (str): + title (str): + description (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + commit_id (str): the commit id of merged PRs. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + PullRequestBasic, + ], + 'oneOf': [ + ], + } diff --git a/clients/python-legacy/lakefs_client/model/pull_request_basic.py b/clients/python-legacy/lakefs_client/model/pull_request_basic.py new file mode 100644 index 00000000000..c0a328f7667 --- /dev/null +++ b/clients/python-legacy/lakefs_client/model/pull_request_basic.py @@ -0,0 +1,269 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from lakefs_client.exceptions import ApiAttributeError + + + +class PullRequestBasic(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'OPEN': "open", + 'CLOSED': "closed", + 'MERGED': "merged", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'status': (str,), # noqa: E501 + 'title': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'status': 'status', # noqa: E501 + 'title': 'title', # noqa: E501 + 'description': 'description', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PullRequestBasic - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): [optional] # noqa: E501 + title (str): [optional] # noqa: E501 + description (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PullRequestBasic - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): [optional] # noqa: E501 + title (str): [optional] # noqa: E501 + description (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/clients/python-legacy/lakefs_client/model/pull_request_creation.py b/clients/python-legacy/lakefs_client/model/pull_request_creation.py new file mode 100644 index 00000000000..07ed0fb9734 --- /dev/null +++ b/clients/python-legacy/lakefs_client/model/pull_request_creation.py @@ -0,0 +1,280 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from lakefs_client.exceptions import ApiAttributeError + + + +class PullRequestCreation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'title': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'source_branch': (str,), # noqa: E501 + 'destination_branch': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'title': 'title', # noqa: E501 + 'description': 'description', # noqa: E501 + 'source_branch': 'source_branch', # noqa: E501 + 'destination_branch': 'destination_branch', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, title, description, source_branch, destination_branch, *args, **kwargs): # noqa: E501 + """PullRequestCreation - a model defined in OpenAPI + + Args: + title (str): + description (str): + source_branch (str): + destination_branch (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.title = title + self.description = description + self.source_branch = source_branch + self.destination_branch = destination_branch + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, title, description, source_branch, destination_branch, *args, **kwargs): # noqa: E501 + """PullRequestCreation - a model defined in OpenAPI + + Args: + title (str): + description (str): + source_branch (str): + destination_branch (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.title = title + self.description = description + self.source_branch = source_branch + self.destination_branch = destination_branch + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/clients/python-legacy/lakefs_client/model/pull_requests_list.py b/clients/python-legacy/lakefs_client/model/pull_requests_list.py new file mode 100644 index 00000000000..6a542d543f9 --- /dev/null +++ b/clients/python-legacy/lakefs_client/model/pull_requests_list.py @@ -0,0 +1,276 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from lakefs_client.exceptions import ApiAttributeError + + +def lazy_import(): + from lakefs_client.model.pagination import Pagination + from lakefs_client.model.pull_request import PullRequest + globals()['Pagination'] = Pagination + globals()['PullRequest'] = PullRequest + + +class PullRequestsList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pagination': (Pagination,), # noqa: E501 + 'results': ([PullRequest],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'pagination': 'pagination', # noqa: E501 + 'results': 'results', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, pagination, results, *args, **kwargs): # noqa: E501 + """PullRequestsList - a model defined in OpenAPI + + Args: + pagination (Pagination): + results ([PullRequest]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pagination = pagination + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, pagination, results, *args, **kwargs): # noqa: E501 + """PullRequestsList - a model defined in OpenAPI + + Args: + pagination (Pagination): + results ([PullRequest]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pagination = pagination + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/clients/python-legacy/lakefs_client/models/__init__.py b/clients/python-legacy/lakefs_client/models/__init__.py index b6252a34034..0ba85ae7ab1 100644 --- a/clients/python-legacy/lakefs_client/models/__init__.py +++ b/clients/python-legacy/lakefs_client/models/__init__.py @@ -77,6 +77,10 @@ from lakefs_client.model.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest from lakefs_client.model.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse from lakefs_client.model.presign_multipart_upload import PresignMultipartUpload +from lakefs_client.model.pull_request import PullRequest +from lakefs_client.model.pull_request_basic import PullRequestBasic +from lakefs_client.model.pull_request_creation import PullRequestCreation +from lakefs_client.model.pull_requests_list import PullRequestsList from lakefs_client.model.range_metadata import RangeMetadata from lakefs_client.model.ref import Ref from lakefs_client.model.ref_list import RefList diff --git a/clients/python-legacy/test/test_experimental_api.py b/clients/python-legacy/test/test_experimental_api.py index e17d2876002..f02468344b3 100644 --- a/clients/python-legacy/test/test_experimental_api.py +++ b/clients/python-legacy/test/test_experimental_api.py @@ -45,6 +45,13 @@ def test_create_presign_multipart_upload(self): """ pass + def test_create_pull_request(self): + """Test case for create_pull_request + + create pull request # noqa: E501 + """ + pass + def test_create_user_external_principal(self): """Test case for create_user_external_principal @@ -52,6 +59,13 @@ def test_create_user_external_principal(self): """ pass + def test_delete_pull_request(self): + """Test case for delete_pull_request + + delete pull request # noqa: E501 + """ + pass + def test_delete_user_external_principal(self): """Test case for delete_user_external_principal @@ -73,6 +87,13 @@ def test_get_external_principal(self): """ pass + def test_get_pull_request(self): + """Test case for get_pull_request + + get pull request # noqa: E501 + """ + pass + def test_hard_reset_branch(self): """Test case for hard_reset_branch @@ -80,6 +101,13 @@ def test_hard_reset_branch(self): """ pass + def test_list_pull_requests(self): + """Test case for list_pull_requests + + list pull requests # noqa: E501 + """ + pass + def test_list_user_external_principals(self): """Test case for list_user_external_principals @@ -94,6 +122,13 @@ def test_sts_login(self): """ pass + def test_update_pull_request(self): + """Test case for update_pull_request + + update pull request # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/clients/python-legacy/test/test_pull_request.py b/clients/python-legacy/test/test_pull_request.py new file mode 100644 index 00000000000..ee0eabab131 --- /dev/null +++ b/clients/python-legacy/test/test_pull_request.py @@ -0,0 +1,38 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import lakefs_client +from lakefs_client.model.pull_request_basic import PullRequestBasic +globals()['PullRequestBasic'] = PullRequestBasic +from lakefs_client.model.pull_request import PullRequest + + +class TestPullRequest(unittest.TestCase): + """PullRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPullRequest(self): + """Test PullRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = PullRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python-legacy/test/test_pull_request_basic.py b/clients/python-legacy/test/test_pull_request_basic.py new file mode 100644 index 00000000000..c7f0c9bd2ea --- /dev/null +++ b/clients/python-legacy/test/test_pull_request_basic.py @@ -0,0 +1,36 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import lakefs_client +from lakefs_client.model.pull_request_basic import PullRequestBasic + + +class TestPullRequestBasic(unittest.TestCase): + """PullRequestBasic unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPullRequestBasic(self): + """Test PullRequestBasic""" + # FIXME: construct object with mandatory attributes with example values + # model = PullRequestBasic() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python-legacy/test/test_pull_request_creation.py b/clients/python-legacy/test/test_pull_request_creation.py new file mode 100644 index 00000000000..7bd4e724af9 --- /dev/null +++ b/clients/python-legacy/test/test_pull_request_creation.py @@ -0,0 +1,36 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import lakefs_client +from lakefs_client.model.pull_request_creation import PullRequestCreation + + +class TestPullRequestCreation(unittest.TestCase): + """PullRequestCreation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPullRequestCreation(self): + """Test PullRequestCreation""" + # FIXME: construct object with mandatory attributes with example values + # model = PullRequestCreation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python-legacy/test/test_pull_requests_list.py b/clients/python-legacy/test/test_pull_requests_list.py new file mode 100644 index 00000000000..0fe7d98c498 --- /dev/null +++ b/clients/python-legacy/test/test_pull_requests_list.py @@ -0,0 +1,40 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import lakefs_client +from lakefs_client.model.pagination import Pagination +from lakefs_client.model.pull_request import PullRequest +globals()['Pagination'] = Pagination +globals()['PullRequest'] = PullRequest +from lakefs_client.model.pull_requests_list import PullRequestsList + + +class TestPullRequestsList(unittest.TestCase): + """PullRequestsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPullRequestsList(self): + """Test PullRequestsList""" + # FIXME: construct object with mandatory attributes with example values + # model = PullRequestsList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python-legacy/test/test_pulls_api.py b/clients/python-legacy/test/test_pulls_api.py new file mode 100644 index 00000000000..8ad5e061029 --- /dev/null +++ b/clients/python-legacy/test/test_pulls_api.py @@ -0,0 +1,64 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import lakefs_client +from lakefs_client.api.pulls_api import PullsApi # noqa: E501 + + +class TestPullsApi(unittest.TestCase): + """PullsApi unit test stubs""" + + def setUp(self): + self.api = PullsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_pull_request(self): + """Test case for create_pull_request + + create pull request # noqa: E501 + """ + pass + + def test_delete_pull_request(self): + """Test case for delete_pull_request + + delete pull request # noqa: E501 + """ + pass + + def test_get_pull_request(self): + """Test case for get_pull_request + + get pull request # noqa: E501 + """ + pass + + def test_list_pull_requests(self): + """Test case for list_pull_requests + + list pull requests # noqa: E501 + """ + pass + + def test_update_pull_request(self): + """Test case for update_pull_request + + update pull request # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES index c41284757f8..ad35c188ed2 100644 --- a/clients/python/.openapi-generator/FILES +++ b/clients/python/.openapi-generator/FILES @@ -77,6 +77,11 @@ docs/PolicyList.md docs/PrepareGCUncommittedRequest.md docs/PrepareGCUncommittedResponse.md docs/PresignMultipartUpload.md +docs/PullRequest.md +docs/PullRequestBasic.md +docs/PullRequestCreation.md +docs/PullRequestsList.md +docs/PullsApi.md docs/RangeMetadata.md docs/Ref.md docs/RefList.md @@ -129,6 +134,7 @@ lakefs_sdk/api/import_api.py lakefs_sdk/api/internal_api.py lakefs_sdk/api/metadata_api.py lakefs_sdk/api/objects_api.py +lakefs_sdk/api/pulls_api.py lakefs_sdk/api/refs_api.py lakefs_sdk/api/repositories_api.py lakefs_sdk/api/staging_api.py @@ -204,6 +210,10 @@ lakefs_sdk/models/policy_list.py lakefs_sdk/models/prepare_gc_uncommitted_request.py lakefs_sdk/models/prepare_gc_uncommitted_response.py lakefs_sdk/models/presign_multipart_upload.py +lakefs_sdk/models/pull_request.py +lakefs_sdk/models/pull_request_basic.py +lakefs_sdk/models/pull_request_creation.py +lakefs_sdk/models/pull_requests_list.py lakefs_sdk/models/range_metadata.py lakefs_sdk/models/ref.py lakefs_sdk/models/ref_list.py @@ -323,6 +333,11 @@ test/test_policy_list.py test/test_prepare_gc_uncommitted_request.py test/test_prepare_gc_uncommitted_response.py test/test_presign_multipart_upload.py +test/test_pull_request.py +test/test_pull_request_basic.py +test/test_pull_request_creation.py +test/test_pull_requests_list.py +test/test_pulls_api.py test/test_range_metadata.py test/test_ref.py test/test_ref_list.py diff --git a/clients/python/README.md b/clients/python/README.md index dc2898428d2..2699707241a 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -173,13 +173,18 @@ Class | Method | HTTP request | Description *ExperimentalApi* | [**abort_presign_multipart_upload**](docs/ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload *ExperimentalApi* | [**complete_presign_multipart_upload**](docs/ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request *ExperimentalApi* | [**create_presign_multipart_upload**](docs/ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +*ExperimentalApi* | [**create_pull_request**](docs/ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request *ExperimentalApi* | [**create_user_external_principal**](docs/ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +*ExperimentalApi* | [**delete_pull_request**](docs/ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request *ExperimentalApi* | [**delete_user_external_principal**](docs/ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExperimentalApi* | [**external_principal_login**](docs/ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator *ExperimentalApi* | [**get_external_principal**](docs/ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +*ExperimentalApi* | [**get_pull_request**](docs/ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request *ExperimentalApi* | [**hard_reset_branch**](docs/ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +*ExperimentalApi* | [**list_pull_requests**](docs/ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests *ExperimentalApi* | [**list_user_external_principals**](docs/ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user *ExperimentalApi* | [**sts_login**](docs/ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +*ExperimentalApi* | [**update_pull_request**](docs/ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *ExternalApi* | [**create_user_external_principal**](docs/ExternalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user *ExternalApi* | [**delete_user_external_principal**](docs/ExternalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExternalApi* | [**external_principal_login**](docs/ExternalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator @@ -228,6 +233,11 @@ Class | Method | HTTP request | Description *ObjectsApi* | [**list_objects**](docs/ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix *ObjectsApi* | [**stat_object**](docs/ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata *ObjectsApi* | [**upload_object**](docs/ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | +*PullsApi* | [**create_pull_request**](docs/PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +*PullsApi* | [**delete_pull_request**](docs/PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +*PullsApi* | [**get_pull_request**](docs/PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +*PullsApi* | [**list_pull_requests**](docs/PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +*PullsApi* | [**update_pull_request**](docs/PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *RefsApi* | [**diff_refs**](docs/RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references *RefsApi* | [**find_merge_base**](docs/RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references *RefsApi* | [**log_commits**](docs/RefsApi.md#log_commits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. @@ -321,6 +331,10 @@ Class | Method | HTTP request | Description - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) - [PresignMultipartUpload](docs/PresignMultipartUpload.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestBasic](docs/PullRequestBasic.md) + - [PullRequestCreation](docs/PullRequestCreation.md) + - [PullRequestsList](docs/PullRequestsList.md) - [RangeMetadata](docs/RangeMetadata.md) - [Ref](docs/Ref.md) - [RefList](docs/RefList.md) diff --git a/clients/python/docs/ExperimentalApi.md b/clients/python/docs/ExperimentalApi.md index bcff98cba07..e9948121a4b 100644 --- a/clients/python/docs/ExperimentalApi.md +++ b/clients/python/docs/ExperimentalApi.md @@ -7,13 +7,18 @@ Method | HTTP request | Description [**abort_presign_multipart_upload**](ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload [**complete_presign_multipart_upload**](ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request [**create_presign_multipart_upload**](ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +[**create_pull_request**](ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request [**create_user_external_principal**](ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +[**delete_pull_request**](ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request [**delete_user_external_principal**](ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user [**external_principal_login**](ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator [**get_external_principal**](ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +[**get_pull_request**](ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request [**hard_reset_branch**](ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +[**list_pull_requests**](ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests [**list_user_external_principals**](ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user [**sts_login**](ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +[**update_pull_request**](ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request # **abort_presign_multipart_upload** @@ -377,6 +382,121 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_pull_request** +> str create_pull_request(repository, pull_request_creation) + +create pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.ExperimentalApi(api_client) + repository = 'repository_example' # str | + pull_request_creation = lakefs_sdk.PullRequestCreation() # PullRequestCreation | + + try: + # create pull request + api_response = api_instance.create_pull_request(repository, pull_request_creation) + print("The response of ExperimentalApi->create_pull_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->create_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md)| | + +### Return type + +**str** + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_user_external_principal** > create_user_external_principal(user_id, principal_id, external_principal_creation=external_principal_creation) @@ -490,6 +610,116 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_pull_request** +> delete_pull_request(repository, pull_request) + +delete pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.ExperimentalApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + + try: + # delete pull request + api_instance.delete_pull_request(repository, pull_request) + except Exception as e: + print("Exception when calling ExperimentalApi->delete_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +void (empty response body) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_user_external_principal** > delete_user_external_principal(user_id, principal_id) @@ -784,6 +1014,118 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_pull_request** +> PullRequest get_pull_request(repository, pull_request) + +get pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.ExperimentalApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + + try: + # get pull request + api_response = api_instance.get_pull_request(repository, pull_request) + print("The response of ExperimentalApi->get_pull_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->get_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **hard_reset_branch** > hard_reset_branch(repository, branch, ref, force=force) @@ -901,6 +1243,124 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_pull_requests** +> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + +list pull requests + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_requests_list import PullRequestsList +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.ExperimentalApi(api_client) + repository = 'repository_example' # str | + prefix = 'prefix_example' # str | return items prefixed with this value (optional) + after = 'after_example' # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) (default to 100) + state = 'all' # str | (optional) (default to 'all') + + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + print("The response of ExperimentalApi->list_pull_requests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->list_pull_requests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **prefix** | **str**| return items prefixed with this value | [optional] + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] [default to 100] + **state** | **str**| | [optional] [default to 'all'] + +### Return type + +[**PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | list of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_user_external_principals** > ExternalPrincipalList list_user_external_principals(user_id, prefix=prefix, after=after, amount=amount) @@ -1089,3 +1549,116 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_pull_request** +> update_pull_request(repository, pull_request, pull_request_basic) + +update pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.ExperimentalApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + pull_request_basic = lakefs_sdk.PullRequestBasic() # PullRequestBasic | + + try: + # update pull request + api_instance.update_pull_request(repository, pull_request, pull_request_basic) + except Exception as e: + print("Exception when calling ExperimentalApi->update_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + **pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/python/docs/PullRequest.md b/clients/python/docs/PullRequest.md new file mode 100644 index 00000000000..00f2c0f4f9a --- /dev/null +++ b/clients/python/docs/PullRequest.md @@ -0,0 +1,37 @@ +# PullRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**creation_date** | **int** | | +**author** | **str** | | +**source_branch** | **str** | | +**destination_branch** | **str** | | +**commit_id** | **str** | the commit id of merged PRs | [optional] +**status** | **str** | | +**title** | **str** | | +**description** | **str** | | + +## Example + +```python +from lakefs_sdk.models.pull_request import PullRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PullRequest from a JSON string +pull_request_instance = PullRequest.from_json(json) +# print the JSON string representation of the object +print PullRequest.to_json() + +# convert the object into a dict +pull_request_dict = pull_request_instance.to_dict() +# create an instance of PullRequest from a dict +pull_request_form_dict = pull_request.from_dict(pull_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python/docs/PullRequestBasic.md b/clients/python/docs/PullRequestBasic.md new file mode 100644 index 00000000000..355bab0ee98 --- /dev/null +++ b/clients/python/docs/PullRequestBasic.md @@ -0,0 +1,31 @@ +# PullRequestBasic + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | [optional] +**title** | **str** | | [optional] +**description** | **str** | | [optional] + +## Example + +```python +from lakefs_sdk.models.pull_request_basic import PullRequestBasic + +# TODO update the JSON string below +json = "{}" +# create an instance of PullRequestBasic from a JSON string +pull_request_basic_instance = PullRequestBasic.from_json(json) +# print the JSON string representation of the object +print PullRequestBasic.to_json() + +# convert the object into a dict +pull_request_basic_dict = pull_request_basic_instance.to_dict() +# create an instance of PullRequestBasic from a dict +pull_request_basic_form_dict = pull_request_basic.from_dict(pull_request_basic_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python/docs/PullRequestCreation.md b/clients/python/docs/PullRequestCreation.md new file mode 100644 index 00000000000..10c42781ff6 --- /dev/null +++ b/clients/python/docs/PullRequestCreation.md @@ -0,0 +1,32 @@ +# PullRequestCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**description** | **str** | | +**source_branch** | **str** | | +**destination_branch** | **str** | | + +## Example + +```python +from lakefs_sdk.models.pull_request_creation import PullRequestCreation + +# TODO update the JSON string below +json = "{}" +# create an instance of PullRequestCreation from a JSON string +pull_request_creation_instance = PullRequestCreation.from_json(json) +# print the JSON string representation of the object +print PullRequestCreation.to_json() + +# convert the object into a dict +pull_request_creation_dict = pull_request_creation_instance.to_dict() +# create an instance of PullRequestCreation from a dict +pull_request_creation_form_dict = pull_request_creation.from_dict(pull_request_creation_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python/docs/PullRequestsList.md b/clients/python/docs/PullRequestsList.md new file mode 100644 index 00000000000..4958c4468d1 --- /dev/null +++ b/clients/python/docs/PullRequestsList.md @@ -0,0 +1,30 @@ +# PullRequestsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | +**results** | [**List[PullRequest]**](PullRequest.md) | | + +## Example + +```python +from lakefs_sdk.models.pull_requests_list import PullRequestsList + +# TODO update the JSON string below +json = "{}" +# create an instance of PullRequestsList from a JSON string +pull_requests_list_instance = PullRequestsList.from_json(json) +# print the JSON string representation of the object +print PullRequestsList.to_json() + +# convert the object into a dict +pull_requests_list_dict = pull_requests_list_instance.to_dict() +# create an instance of PullRequestsList from a dict +pull_requests_list_form_dict = pull_requests_list.from_dict(pull_requests_list_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python/docs/PullsApi.md b/clients/python/docs/PullsApi.md new file mode 100644 index 00000000000..dd6214c9961 --- /dev/null +++ b/clients/python/docs/PullsApi.md @@ -0,0 +1,581 @@ +# lakefs_sdk.PullsApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_pull_request**](PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +[**delete_pull_request**](PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +[**get_pull_request**](PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +[**list_pull_requests**](PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +[**update_pull_request**](PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request + + +# **create_pull_request** +> str create_pull_request(repository, pull_request_creation) + +create pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.PullsApi(api_client) + repository = 'repository_example' # str | + pull_request_creation = lakefs_sdk.PullRequestCreation() # PullRequestCreation | + + try: + # create pull request + api_response = api_instance.create_pull_request(repository, pull_request_creation) + print("The response of PullsApi->create_pull_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PullsApi->create_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md)| | + +### Return type + +**str** + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | pull request id | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pull_request** +> delete_pull_request(repository, pull_request) + +delete pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.PullsApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + + try: + # delete pull request + api_instance.delete_pull_request(repository, pull_request) + except Exception as e: + print("Exception when calling PullsApi->delete_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +void (empty response body) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pull_request** +> PullRequest get_pull_request(repository, pull_request) + +get pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.PullsApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + + try: + # get pull request + api_response = api_instance.get_pull_request(repository, pull_request) + print("The response of PullsApi->get_pull_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PullsApi->get_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | pull request | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_pull_requests** +> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + +list pull requests + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_requests_list import PullRequestsList +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.PullsApi(api_client) + repository = 'repository_example' # str | + prefix = 'prefix_example' # str | return items prefixed with this value (optional) + after = 'after_example' # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) (default to 100) + state = 'all' # str | (optional) (default to 'all') + + try: + # list pull requests + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + print("The response of PullsApi->list_pull_requests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PullsApi->list_pull_requests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **prefix** | **str**| return items prefixed with this value | [optional] + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] [default to 100] + **state** | **str**| | [optional] [default to 'all'] + +### Return type + +[**PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | list of pull requests | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pull_request** +> update_pull_request(repository, pull_request, pull_request_basic) + +update pull request + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): + +```python +import time +import os +import lakefs_sdk +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_sdk.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_sdk.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lakefs_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lakefs_sdk.PullsApi(api_client) + repository = 'repository_example' # str | + pull_request = 'pull_request_example' # str | pull request id + pull_request_basic = lakefs_sdk.PullRequestBasic() # PullRequestBasic | + + try: + # update pull request + api_instance.update_pull_request(repository, pull_request, pull_request_basic) + except Exception as e: + print("Exception when calling PullsApi->update_pull_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **pull_request** | **str**| pull request id | + **pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[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 + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | pull request deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**420** | too many requests | - | +**0** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/python/lakefs_sdk/__init__.py b/clients/python/lakefs_sdk/__init__.py index 6cbfa9f24f7..f966cca2c24 100644 --- a/clients/python/lakefs_sdk/__init__.py +++ b/clients/python/lakefs_sdk/__init__.py @@ -30,6 +30,7 @@ from lakefs_sdk.api.internal_api import InternalApi from lakefs_sdk.api.metadata_api import MetadataApi from lakefs_sdk.api.objects_api import ObjectsApi +from lakefs_sdk.api.pulls_api import PullsApi from lakefs_sdk.api.refs_api import RefsApi from lakefs_sdk.api.repositories_api import RepositoriesApi from lakefs_sdk.api.staging_api import StagingApi @@ -112,6 +113,10 @@ from lakefs_sdk.models.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest from lakefs_sdk.models.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.models.pull_requests_list import PullRequestsList from lakefs_sdk.models.range_metadata import RangeMetadata from lakefs_sdk.models.ref import Ref from lakefs_sdk.models.ref_list import RefList diff --git a/clients/python/lakefs_sdk/api/__init__.py b/clients/python/lakefs_sdk/api/__init__.py index cf5184bbae1..5d8b5c385f7 100644 --- a/clients/python/lakefs_sdk/api/__init__.py +++ b/clients/python/lakefs_sdk/api/__init__.py @@ -13,6 +13,7 @@ from lakefs_sdk.api.internal_api import InternalApi from lakefs_sdk.api.metadata_api import MetadataApi from lakefs_sdk.api.objects_api import ObjectsApi +from lakefs_sdk.api.pulls_api import PullsApi from lakefs_sdk.api.refs_api import RefsApi from lakefs_sdk.api.repositories_api import RepositoriesApi from lakefs_sdk.api.staging_api import StagingApi diff --git a/clients/python/lakefs_sdk/api/experimental_api.py b/clients/python/lakefs_sdk/api/experimental_api.py index 2df5e2d6f68..3cd9f612500 100644 --- a/clients/python/lakefs_sdk/api/experimental_api.py +++ b/clients/python/lakefs_sdk/api/experimental_api.py @@ -39,6 +39,10 @@ from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.models.pull_requests_list import PullRequestsList from lakefs_sdk.models.sts_auth_request import StsAuthRequest from lakefs_sdk.api_client import ApiClient @@ -588,21 +592,19 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, _request_auth=_params.get('_request_auth')) @validate_arguments - def create_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> None: # noqa: E501 - """attach external principal to user # noqa: E501 + def create_pull_request(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> str: # noqa: E501 + """create pull request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) + >>> thread = api.create_pull_request(repository, pull_request_creation, async_req=True) >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param principal_id: (required) - :type principal_id: str - :param external_principal_creation: - :type external_principal_creation: ExternalPrincipalCreation + :param repository: (required) + :type repository: str + :param pull_request_creation: (required) + :type pull_request_creation: PullRequestCreation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -612,29 +614,27 @@ def create_user_external_principal(self, user_id : StrictStr, principal_id : Str :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: str """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 + raise ValueError("Error! Please call the create_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_pull_request_with_http_info(repository, pull_request_creation, **kwargs) # noqa: E501 @validate_arguments - def create_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """attach external principal to user # noqa: E501 + def create_pull_request_with_http_info(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> ApiResponse: # noqa: E501 + """create pull request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) + >>> thread = api.create_pull_request_with_http_info(repository, pull_request_creation, async_req=True) >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param principal_id: (required) - :type principal_id: str - :param external_principal_creation: - :type external_principal_creation: ExternalPrincipalCreation + :param repository: (required) + :type repository: str + :param pull_request_creation: (required) + :type pull_request_creation: PullRequestCreation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -657,15 +657,14 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'user_id', - 'principal_id', - 'external_principal_creation' + 'repository', + 'pull_request_creation' ] _all_params.extend( [ @@ -684,7 +683,7 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_user_external_principal" % _key + " to method create_pull_request" % _key ) _params[_key] = _val del _params['kwargs'] @@ -693,15 +692,12 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri # process the path parameters _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + if _params['repository']: + _path_params['repository'] = _params['repository'] # process the query parameters _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) - # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -709,12 +705,12 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri _files = {} # process the body parameter _body_params = None - if _params['external_principal_creation'] is not None: - _body_params = _params['external_principal_creation'] + if _params['pull_request_creation'] is not None: + _body_params = _params['pull_request_creation'] # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + ['text/html', 'application/json']) # noqa: E501 # set the HTTP header `Content-Type` _content_types_list = _params.get('_content_type', @@ -726,10 +722,18 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri # authentication setting _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + _response_types_map = { + '201': "str", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'POST', + '/repositories/{repository}/pulls', 'POST', _path_params, _query_params, _header_params, @@ -746,19 +750,21 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri _request_auth=_params.get('_request_auth')) @validate_arguments - def delete_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete external principal from user # noqa: E501 + def create_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> None: # noqa: E501 + """attach external principal to user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) + >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) >>> result = thread.get() :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -772,23 +778,25 @@ def delete_user_external_principal(self, user_id : StrictStr, principal_id : Str """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 + raise ValueError("Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 @validate_arguments - def delete_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete external principal from user # noqa: E501 + def create_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 + """attach external principal to user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_external_principal_with_http_info(user_id, principal_id, async_req=True) + >>> thread = api.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) >>> result = thread.get() :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -818,7 +826,8 @@ def delete_user_external_principal_with_http_info(self, user_id : StrictStr, pri _all_params = [ 'user_id', - 'principal_id' + 'principal_id', + 'external_principal_creation' ] _all_params.extend( [ @@ -837,7 +846,7 @@ def delete_user_external_principal_with_http_info(self, user_id : StrictStr, pri if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method delete_user_external_principal" % _key + " to method create_user_external_principal" % _key ) _params[_key] = _val del _params['kwargs'] @@ -862,17 +871,27 @@ def delete_user_external_principal_with_http_info(self, user_id : StrictStr, pri _files = {} # process the body parameter _body_params = None + if _params['external_principal_creation'] is not None: + _body_params = _params['external_principal_creation'] + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + # authentication setting _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = {} return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'DELETE', + '/auth/users/{userId}/external/principals', 'POST', _path_params, _query_params, _header_params, @@ -889,17 +908,19 @@ def delete_user_external_principal_with_http_info(self, user_id : StrictStr, pri _request_auth=_params.get('_request_auth')) @validate_arguments - def external_principal_login(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 + def delete_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> None: # noqa: E501 + """delete pull request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login(external_login_information, async_req=True) + >>> thread = api.delete_pull_request(repository, pull_request, async_req=True) >>> result = thread.get() - :param external_login_information: - :type external_login_information: ExternalLoginInformation + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -909,25 +930,27 @@ def external_principal_login(self, external_login_information : Optional[Externa :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: AuthenticationToken + :rtype: None """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 + raise ValueError("Error! Please call the delete_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 @validate_arguments - def external_principal_login_with_http_info(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 + def delete_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> ApiResponse: # noqa: E501 + """delete pull request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) + >>> thread = api.delete_pull_request_with_http_info(repository, pull_request, async_req=True) >>> result = thread.get() - :param external_login_information: - :type external_login_information: ExternalLoginInformation + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -950,13 +973,14 @@ def external_principal_login_with_http_info(self, external_login_information : O :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ _params = locals() _all_params = [ - 'external_login_information' + 'repository', + 'pull_request' ] _all_params.extend( [ @@ -975,7 +999,7 @@ def external_principal_login_with_http_info(self, external_login_information : O if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method external_principal_login" % _key + " to method delete_pull_request" % _key ) _params[_key] = _val del _params['kwargs'] @@ -984,6 +1008,12 @@ def external_principal_login_with_http_info(self, external_login_information : O # process the path parameters _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + # process the query parameters _query_params = [] @@ -994,34 +1024,17 @@ def external_principal_login_with_http_info(self, external_login_information : O _files = {} # process the body parameter _body_params = None - if _params['external_login_information'] is not None: - _body_params = _params['external_login_information'] - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - # authentication setting - _auth_settings = [] # noqa: E501 + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "AuthenticationToken", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _response_types_map = {} return self.api_client.call_api( - '/auth/external/principal/login', 'POST', + '/repositories/{repository}/pulls/{pull_request}', 'DELETE', _path_params, _query_params, _header_params, @@ -1038,15 +1051,17 @@ def external_principal_login_with_http_info(self, external_login_information : O _request_auth=_params.get('_request_auth')) @validate_arguments - def get_external_principal(self, principal_id : StrictStr, **kwargs) -> ExternalPrincipal: # noqa: E501 - """describe external principal by id # noqa: E501 + def delete_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> None: # noqa: E501 + """delete external principal from user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal(principal_id, async_req=True) + >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) >>> result = thread.get() + :param user_id: (required) + :type user_id: str :param principal_id: (required) :type principal_id: str :param async_req: Whether to execute the request asynchronously. @@ -1058,23 +1073,25 @@ def get_external_principal(self, principal_id : StrictStr, **kwargs) -> External :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: ExternalPrincipal + :rtype: None """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 + raise ValueError("Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 @validate_arguments - def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """describe external principal by id # noqa: E501 + def delete_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 + """delete external principal from user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) + >>> thread = api.delete_user_external_principal_with_http_info(user_id, principal_id, async_req=True) >>> result = thread.get() + :param user_id: (required) + :type user_id: str :param principal_id: (required) :type principal_id: str :param async_req: Whether to execute the request asynchronously. @@ -1099,12 +1116,13 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ _params = locals() _all_params = [ + 'user_id', 'principal_id' ] _all_params.extend( @@ -1124,7 +1142,7 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_external_principal" % _key + " to method delete_user_external_principal" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1133,6 +1151,9 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar # process the path parameters _path_params = {} + if _params['user_id']: + _path_params['userId'] = _params['user_id'] + # process the query parameters _query_params = [] @@ -1153,15 +1174,10 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar # authentication setting _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipal", - '401': "Error", - '404': "Error", - '420': None, - } + _response_types_map = {} return self.api_client.call_api( - '/auth/external/principals', 'GET', + '/auth/users/{userId}/external/principals', 'DELETE', _path_params, _query_params, _header_params, @@ -1178,24 +1194,17 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar _request_auth=_params.get('_request_auth')) @validate_arguments - def hard_reset_branch(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """hard reset branch # noqa: E501 + def external_principal_login(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 + """perform a login using an external authenticator # noqa: E501 - Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.hard_reset_branch(repository, branch, ref, force, async_req=True) + >>> thread = api.external_principal_login(external_login_information, async_req=True) >>> result = thread.get() - :param repository: (required) - :type repository: str - :param branch: (required) - :type branch: str - :param ref: After reset, branch will point at this reference. (required) - :type ref: str - :param force: - :type force: bool + :param external_login_information: + :type external_login_information: ExternalLoginInformation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -1205,32 +1214,25 @@ def hard_reset_branch(self, repository : StrictStr, branch : StrictStr, ref : An :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: AuthenticationToken """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the hard_reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.hard_reset_branch_with_http_info(repository, branch, ref, force, **kwargs) # noqa: E501 + raise ValueError("Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 @validate_arguments - def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """hard reset branch # noqa: E501 + def external_principal_login_with_http_info(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 + """perform a login using an external authenticator # noqa: E501 - Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.hard_reset_branch_with_http_info(repository, branch, ref, force, async_req=True) + >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) >>> result = thread.get() - :param repository: (required) - :type repository: str - :param branch: (required) - :type branch: str - :param ref: After reset, branch will point at this reference. (required) - :type ref: str - :param force: - :type force: bool + :param external_login_information: + :type external_login_information: ExternalLoginInformation :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1253,16 +1255,13 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'repository', - 'branch', - 'ref', - 'force' + 'external_login_information' ] _all_params.extend( [ @@ -1281,7 +1280,7 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method hard_reset_branch" % _key + " to method external_principal_login" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1290,21 +1289,9 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri # process the path parameters _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['branch']: - _path_params['branch'] = _params['branch'] - # process the query parameters _query_params = [] - if _params.get('ref') is not None: # noqa: E501 - _query_params.append(('ref', _params['ref'])) - - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) - # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -1312,21 +1299,659 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri _files = {} # process the body parameter _body_params = None + if _params['external_login_information'] is not None: + _body_params = _params['external_login_information'] + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list - _response_types_map = {} + # authentication setting + _auth_settings = [] # noqa: E501 - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/hard_reset', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, + _response_types_map = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/auth/external/principal/login', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_external_principal(self, principal_id : StrictStr, **kwargs) -> ExternalPrincipal: # noqa: E501 + """describe external principal by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_external_principal(principal_id, async_req=True) + >>> result = thread.get() + + :param principal_id: (required) + :type principal_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ExternalPrincipal + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 + """describe external principal by id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) + >>> result = thread.get() + + :param principal_id: (required) + :type principal_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'principal_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_external_principal" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + if _params.get('principal_id') is not None: # noqa: E501 + _query_params.append(('principalId', _params['principal_id'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/auth/external/principals', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> PullRequest: # noqa: E501 + """get pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pull_request(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: PullRequest + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 + + @validate_arguments + def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> ApiResponse: # noqa: E501 + """get pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pull_request_with_http_info(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PullRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '200': "PullRequest", + '401': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/repositories/{repository}/pulls/{pull_request}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def hard_reset_branch(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 + """hard reset branch # noqa: E501 + + Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.hard_reset_branch(repository, branch, ref, force, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param ref: After reset, branch will point at this reference. (required) + :type ref: str + :param force: + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the hard_reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.hard_reset_branch_with_http_info(repository, branch, ref, force, **kwargs) # noqa: E501 + + @validate_arguments + def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 + """hard reset branch # noqa: E501 + + Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.hard_reset_branch_with_http_info(repository, branch, ref, force, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param ref: After reset, branch will point at this reference. (required) + :type ref: str + :param force: + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'repository', + 'branch', + 'ref', + 'force' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method hard_reset_branch" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['branch']: + _path_params['branch'] = _params['branch'] + + + # process the query parameters + _query_params = [] + if _params.get('ref') is not None: # noqa: E501 + _query_params.append(('ref', _params['ref'])) + + if _params.get('force') is not None: # noqa: E501 + _query_params.append(('force', _params['force'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/repositories/{repository}/branches/{branch}/hard_reset', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests(repository, prefix, after, amount, state, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param state: + :type state: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: PullRequestsList + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_pull_requests_with_http_info(repository, prefix, after, amount, state, **kwargs) # noqa: E501 + + @validate_arguments + def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, state, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param state: + :type state: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PullRequestsList, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'prefix', + 'after', + 'amount', + 'state' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pull_requests" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + + # process the query parameters + _query_params = [] + if _params.get('prefix') is not None: # noqa: E501 + _query_params.append(('prefix', _params['prefix'])) + + if _params.get('after') is not None: # noqa: E501 + _query_params.append(('after', _params['after'])) + + if _params.get('amount') is not None: # noqa: E501 + _query_params.append(('amount', _params['amount'])) + + if _params.get('state') is not None: # noqa: E501 + _query_params.append(('state', _params['state'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '200': "PullRequestsList", + '401': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/repositories/{repository}/pulls', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, @@ -1647,3 +2272,161 @@ def sts_login_with_http_info(self, sts_auth_request : StsAuthRequest, **kwargs) _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], pull_request_basic : PullRequestBasic, **kwargs) -> None: # noqa: E501 + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param pull_request_basic: (required) + :type pull_request_basic: PullRequestBasic + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_pull_request_with_http_info(repository, pull_request, pull_request_basic, **kwargs) # noqa: E501 + + @validate_arguments + def update_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], pull_request_basic : PullRequestBasic, **kwargs) -> ApiResponse: # noqa: E501 + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request_with_http_info(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param pull_request_basic: (required) + :type pull_request_basic: PullRequestBasic + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request', + 'pull_request_basic' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['pull_request_basic'] is not None: + _body_params = _params['pull_request_basic'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/repositories/{repository}/pulls/{pull_request}', 'PATCH', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/clients/python/lakefs_sdk/api/pulls_api.py b/clients/python/lakefs_sdk/api/pulls_api.py new file mode 100644 index 00000000000..39ac873a4a3 --- /dev/null +++ b/clients/python/lakefs_sdk/api/pulls_api.py @@ -0,0 +1,835 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +try: + from pydantic.v1 import Field, StrictStr, conint +except ImportError: + from pydantic import Field, StrictStr, conint + +from typing import Optional + +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.models.pull_requests_list import PullRequestsList + +from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_response import ApiResponse +from lakefs_sdk.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class PullsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + def create_pull_request(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> str: # noqa: E501 + """create pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_pull_request(repository, pull_request_creation, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request_creation: (required) + :type pull_request_creation: PullRequestCreation + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_pull_request_with_http_info(repository, pull_request_creation, **kwargs) # noqa: E501 + + @validate_arguments + def create_pull_request_with_http_info(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> ApiResponse: # noqa: E501 + """create pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_pull_request_with_http_info(repository, pull_request_creation, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request_creation: (required) + :type pull_request_creation: PullRequestCreation + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request_creation' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['pull_request_creation'] is not None: + _body_params = _params['pull_request_creation'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['text/html', 'application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '201': "str", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + + return self.api_client.call_api( + '/repositories/{repository}/pulls', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def delete_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> None: # noqa: E501 + """delete pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pull_request(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 + + @validate_arguments + def delete_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> ApiResponse: # noqa: E501 + """delete pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pull_request_with_http_info(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/repositories/{repository}/pulls/{pull_request}', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> PullRequest: # noqa: E501 + """get pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pull_request(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: PullRequest + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 + + @validate_arguments + def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], **kwargs) -> ApiResponse: # noqa: E501 + """get pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pull_request_with_http_info(repository, pull_request, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PullRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '200': "PullRequest", + '401': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/repositories/{repository}/pulls/{pull_request}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests(repository, prefix, after, amount, state, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param state: + :type state: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: PullRequestsList + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_pull_requests_with_http_info(repository, prefix, after, amount, state, **kwargs) # noqa: E501 + + @validate_arguments + def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 + """list pull requests # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, state, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param state: + :type state: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PullRequestsList, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'prefix', + 'after', + 'amount', + 'state' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pull_requests" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + + # process the query parameters + _query_params = [] + if _params.get('prefix') is not None: # noqa: E501 + _query_params.append(('prefix', _params['prefix'])) + + if _params.get('after') is not None: # noqa: E501 + _query_params.append(('after', _params['after'])) + + if _params.get('amount') is not None: # noqa: E501 + _query_params.append(('amount', _params['amount'])) + + if _params.get('state') is not None: # noqa: E501 + _query_params.append(('state', _params['state'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = { + '200': "PullRequestsList", + '401': "Error", + '404': "Error", + '420': None, + } + + return self.api_client.call_api( + '/repositories/{repository}/pulls', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_pull_request(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], pull_request_basic : PullRequestBasic, **kwargs) -> None: # noqa: E501 + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param pull_request_basic: (required) + :type pull_request_basic: PullRequestBasic + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_pull_request_with_http_info(repository, pull_request, pull_request_basic, **kwargs) # noqa: E501 + + @validate_arguments + def update_pull_request_with_http_info(self, repository : StrictStr, pull_request : Annotated[StrictStr, Field(..., description="pull request id")], pull_request_basic : PullRequestBasic, **kwargs) -> ApiResponse: # noqa: E501 + """update pull request # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pull_request_with_http_info(repository, pull_request, pull_request_basic, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param pull_request: pull request id (required) + :type pull_request: str + :param pull_request_basic: (required) + :type pull_request_basic: PullRequestBasic + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'repository', + 'pull_request', + 'pull_request_basic' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pull_request" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['repository']: + _path_params['repository'] = _params['repository'] + + if _params['pull_request']: + _path_params['pull_request'] = _params['pull_request'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['pull_request_basic'] is not None: + _body_params = _params['pull_request_basic'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/repositories/{repository}/pulls/{pull_request}', 'PATCH', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/clients/python/lakefs_sdk/client.py b/clients/python/lakefs_sdk/client.py index af7ba26553f..4d596b4ed33 100644 --- a/clients/python/lakefs_sdk/client.py +++ b/clients/python/lakefs_sdk/client.py @@ -14,6 +14,7 @@ from lakefs_sdk.api import internal_api from lakefs_sdk.api import metadata_api from lakefs_sdk.api import objects_api +from lakefs_sdk.api import pulls_api from lakefs_sdk.api import refs_api from lakefs_sdk.api import repositories_api from lakefs_sdk.api import staging_api @@ -70,6 +71,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.internal_api = internal_api.InternalApi(self._api) self.metadata_api = metadata_api.MetadataApi(self._api) self.objects_api = objects_api.ObjectsApi(self._api) + self.pulls_api = pulls_api.PullsApi(self._api) self.refs_api = refs_api.RefsApi(self._api) self.repositories_api = repositories_api.RepositoriesApi(self._api) self.staging_api = staging_api.StagingApi(self._api) diff --git a/clients/python/lakefs_sdk/models/__init__.py b/clients/python/lakefs_sdk/models/__init__.py index 4894391e15f..51c64e30838 100644 --- a/clients/python/lakefs_sdk/models/__init__.py +++ b/clients/python/lakefs_sdk/models/__init__.py @@ -80,6 +80,10 @@ from lakefs_sdk.models.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest from lakefs_sdk.models.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload +from lakefs_sdk.models.pull_request import PullRequest +from lakefs_sdk.models.pull_request_basic import PullRequestBasic +from lakefs_sdk.models.pull_request_creation import PullRequestCreation +from lakefs_sdk.models.pull_requests_list import PullRequestsList from lakefs_sdk.models.range_metadata import RangeMetadata from lakefs_sdk.models.ref import Ref from lakefs_sdk.models.ref_list import RefList diff --git a/clients/python/lakefs_sdk/models/pull_request.py b/clients/python/lakefs_sdk/models/pull_request.py new file mode 100644 index 00000000000..69dd08c4ed2 --- /dev/null +++ b/clients/python/lakefs_sdk/models/pull_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, validator + +class PullRequest(BaseModel): + """ + PullRequest + """ + id: StrictStr = Field(...) + creation_date: StrictInt = Field(...) + author: StrictStr = Field(...) + source_branch: StrictStr = Field(...) + destination_branch: StrictStr = Field(...) + commit_id: Optional[StrictStr] = Field(None, description="the commit id of merged PRs") + status: StrictStr = Field(...) + title: StrictStr = Field(...) + description: StrictStr = Field(...) + __properties = ["status", "title", "description"] + + @validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in ('open', 'closed', 'merged'): + raise ValueError("must be one of enum values ('open', 'closed', 'merged')") + return value + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PullRequest: + """Create an instance of PullRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PullRequest: + """Create an instance of PullRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PullRequest.parse_obj(obj) + + _obj = PullRequest.parse_obj({ + "status": obj.get("status"), + "title": obj.get("title"), + "description": obj.get("description") + }) + return _obj + + diff --git a/clients/python/lakefs_sdk/models/pull_request_basic.py b/clients/python/lakefs_sdk/models/pull_request_basic.py new file mode 100644 index 00000000000..b6bf51d8912 --- /dev/null +++ b/clients/python/lakefs_sdk/models/pull_request_basic.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +try: + from pydantic.v1 import BaseModel, StrictStr, validator +except ImportError: + from pydantic import BaseModel, StrictStr, validator + +class PullRequestBasic(BaseModel): + """ + PullRequestBasic + """ + status: Optional[StrictStr] = None + title: Optional[StrictStr] = None + description: Optional[StrictStr] = None + __properties = ["status", "title", "description"] + + @validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('open', 'closed', 'merged'): + raise ValueError("must be one of enum values ('open', 'closed', 'merged')") + return value + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PullRequestBasic: + """Create an instance of PullRequestBasic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PullRequestBasic: + """Create an instance of PullRequestBasic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PullRequestBasic.parse_obj(obj) + + _obj = PullRequestBasic.parse_obj({ + "status": obj.get("status"), + "title": obj.get("title"), + "description": obj.get("description") + }) + return _obj + + diff --git a/clients/python/lakefs_sdk/models/pull_request_creation.py b/clients/python/lakefs_sdk/models/pull_request_creation.py new file mode 100644 index 00000000000..ad246553fce --- /dev/null +++ b/clients/python/lakefs_sdk/models/pull_request_creation.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + + +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr + +class PullRequestCreation(BaseModel): + """ + PullRequestCreation + """ + title: StrictStr = Field(...) + description: StrictStr = Field(...) + source_branch: StrictStr = Field(...) + destination_branch: StrictStr = Field(...) + __properties = ["title", "description", "source_branch", "destination_branch"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PullRequestCreation: + """Create an instance of PullRequestCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PullRequestCreation: + """Create an instance of PullRequestCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PullRequestCreation.parse_obj(obj) + + _obj = PullRequestCreation.parse_obj({ + "title": obj.get("title"), + "description": obj.get("description"), + "source_branch": obj.get("source_branch"), + "destination_branch": obj.get("destination_branch") + }) + return _obj + + diff --git a/clients/python/lakefs_sdk/models/pull_requests_list.py b/clients/python/lakefs_sdk/models/pull_requests_list.py new file mode 100644 index 00000000000..eb0a893fa84 --- /dev/null +++ b/clients/python/lakefs_sdk/models/pull_requests_list.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist +from lakefs_sdk.models.pagination import Pagination +from lakefs_sdk.models.pull_request import PullRequest + +class PullRequestsList(BaseModel): + """ + PullRequestsList + """ + pagination: Pagination = Field(...) + results: conlist(PullRequest) = Field(...) + __properties = ["pagination", "results"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PullRequestsList: + """Create an instance of PullRequestsList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PullRequestsList: + """Create an instance of PullRequestsList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PullRequestsList.parse_obj(obj) + + _obj = PullRequestsList.parse_obj({ + "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, + "results": [PullRequest.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/clients/python/test/test_experimental_api.py b/clients/python/test/test_experimental_api.py index a831f98a15e..07290c77594 100644 --- a/clients/python/test/test_experimental_api.py +++ b/clients/python/test/test_experimental_api.py @@ -50,6 +50,13 @@ def test_create_presign_multipart_upload(self): """ pass + def test_create_pull_request(self): + """Test case for create_pull_request + + create pull request # noqa: E501 + """ + pass + def test_create_user_external_principal(self): """Test case for create_user_external_principal @@ -57,6 +64,13 @@ def test_create_user_external_principal(self): """ pass + def test_delete_pull_request(self): + """Test case for delete_pull_request + + delete pull request # noqa: E501 + """ + pass + def test_delete_user_external_principal(self): """Test case for delete_user_external_principal @@ -78,6 +92,13 @@ def test_get_external_principal(self): """ pass + def test_get_pull_request(self): + """Test case for get_pull_request + + get pull request # noqa: E501 + """ + pass + def test_hard_reset_branch(self): """Test case for hard_reset_branch @@ -85,6 +106,13 @@ def test_hard_reset_branch(self): """ pass + def test_list_pull_requests(self): + """Test case for list_pull_requests + + list pull requests # noqa: E501 + """ + pass + def test_list_user_external_principals(self): """Test case for list_user_external_principals @@ -99,6 +127,13 @@ def test_sts_login(self): """ pass + def test_update_pull_request(self): + """Test case for update_pull_request + + update pull request # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/clients/python/test/test_pull_request.py b/clients/python/test/test_pull_request.py new file mode 100644 index 00000000000..d424b015e2d --- /dev/null +++ b/clients/python/test/test_pull_request.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import lakefs_sdk +from lakefs_sdk.models.pull_request import PullRequest # noqa: E501 +from lakefs_sdk.rest import ApiException + +class TestPullRequest(unittest.TestCase): + """PullRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test PullRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PullRequest` + """ + model = lakefs_sdk.models.pull_request.PullRequest() # noqa: E501 + if include_optional : + return PullRequest( + id = '', + creation_date = 56, + author = '', + source_branch = '', + destination_branch = '', + commit_id = '', + status = 'open', + title = '', + description = '' + ) + else : + return PullRequest( + id = '', + creation_date = 56, + author = '', + source_branch = '', + destination_branch = '', + status = 'open', + title = '', + description = '', + ) + """ + + def testPullRequest(self): + """Test PullRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_pull_request_basic.py b/clients/python/test/test_pull_request_basic.py new file mode 100644 index 00000000000..79f09a2a0cb --- /dev/null +++ b/clients/python/test/test_pull_request_basic.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import lakefs_sdk +from lakefs_sdk.models.pull_request_basic import PullRequestBasic # noqa: E501 +from lakefs_sdk.rest import ApiException + +class TestPullRequestBasic(unittest.TestCase): + """PullRequestBasic unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test PullRequestBasic + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PullRequestBasic` + """ + model = lakefs_sdk.models.pull_request_basic.PullRequestBasic() # noqa: E501 + if include_optional : + return PullRequestBasic( + status = 'open', + title = '', + description = '' + ) + else : + return PullRequestBasic( + ) + """ + + def testPullRequestBasic(self): + """Test PullRequestBasic""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_pull_request_creation.py b/clients/python/test/test_pull_request_creation.py new file mode 100644 index 00000000000..ad93f09e0b7 --- /dev/null +++ b/clients/python/test/test_pull_request_creation.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import lakefs_sdk +from lakefs_sdk.models.pull_request_creation import PullRequestCreation # noqa: E501 +from lakefs_sdk.rest import ApiException + +class TestPullRequestCreation(unittest.TestCase): + """PullRequestCreation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test PullRequestCreation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PullRequestCreation` + """ + model = lakefs_sdk.models.pull_request_creation.PullRequestCreation() # noqa: E501 + if include_optional : + return PullRequestCreation( + title = '', + description = '', + source_branch = '', + destination_branch = '' + ) + else : + return PullRequestCreation( + title = '', + description = '', + source_branch = '', + destination_branch = '', + ) + """ + + def testPullRequestCreation(self): + """Test PullRequestCreation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_pull_requests_list.py b/clients/python/test/test_pull_requests_list.py new file mode 100644 index 00000000000..40c39235db8 --- /dev/null +++ b/clients/python/test/test_pull_requests_list.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import lakefs_sdk +from lakefs_sdk.models.pull_requests_list import PullRequestsList # noqa: E501 +from lakefs_sdk.rest import ApiException + +class TestPullRequestsList(unittest.TestCase): + """PullRequestsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test PullRequestsList + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PullRequestsList` + """ + model = lakefs_sdk.models.pull_requests_list.PullRequestsList() # noqa: E501 + if include_optional : + return PullRequestsList( + pagination = lakefs_sdk.models.pagination.Pagination( + has_more = True, + next_offset = '', + results = 0, + max_per_page = 0, ), + results = [ + lakefs_sdk.models.pull_request.PullRequest( + id = '', + creation_date = 56, + author = '', + source_branch = '', + destination_branch = '', + commit_id = '', ) + ] + ) + else : + return PullRequestsList( + pagination = lakefs_sdk.models.pagination.Pagination( + has_more = True, + next_offset = '', + results = 0, + max_per_page = 0, ), + results = [ + lakefs_sdk.models.pull_request.PullRequest( + id = '', + creation_date = 56, + author = '', + source_branch = '', + destination_branch = '', + commit_id = '', ) + ], + ) + """ + + def testPullRequestsList(self): + """Test PullRequestsList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_pulls_api.py b/clients/python/test/test_pulls_api.py new file mode 100644 index 00000000000..00a530dd045 --- /dev/null +++ b/clients/python/test/test_pulls_api.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API + + The version of the OpenAPI document: 1.0.0 + Contact: services@treeverse.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import lakefs_sdk +from lakefs_sdk.api.pulls_api import PullsApi # noqa: E501 +from lakefs_sdk.rest import ApiException + + +class TestPullsApi(unittest.TestCase): + """PullsApi unit test stubs""" + + def setUp(self): + self.api = lakefs_sdk.api.pulls_api.PullsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_pull_request(self): + """Test case for create_pull_request + + create pull request # noqa: E501 + """ + pass + + def test_delete_pull_request(self): + """Test case for delete_pull_request + + delete pull request # noqa: E501 + """ + pass + + def test_get_pull_request(self): + """Test case for get_pull_request + + get pull request # noqa: E501 + """ + pass + + def test_list_pull_requests(self): + """Test case for list_pull_requests + + list pull requests # noqa: E501 + """ + pass + + def test_update_pull_request(self): + """Test case for update_pull_request + + update pull request # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/rust/.openapi-generator/FILES b/clients/rust/.openapi-generator/FILES index 7391d0db7c5..90e32cc61b1 100644 --- a/clients/rust/.openapi-generator/FILES +++ b/clients/rust/.openapi-generator/FILES @@ -80,6 +80,11 @@ docs/PolicyList.md docs/PrepareGcUncommittedRequest.md docs/PrepareGcUncommittedResponse.md docs/PresignMultipartUpload.md +docs/PullRequest.md +docs/PullRequestBasic.md +docs/PullRequestCreation.md +docs/PullRequestsList.md +docs/PullsApi.md docs/RangeMetadata.md docs/Ref.md docs/RefList.md @@ -133,6 +138,7 @@ src/apis/internal_api.rs src/apis/metadata_api.rs src/apis/mod.rs src/apis/objects_api.rs +src/apis/pulls_api.rs src/apis/refs_api.rs src/apis/repositories_api.rs src/apis/staging_api.rs @@ -205,6 +211,10 @@ src/models/policy_list.rs src/models/prepare_gc_uncommitted_request.rs src/models/prepare_gc_uncommitted_response.rs src/models/presign_multipart_upload.rs +src/models/pull_request.rs +src/models/pull_request_basic.rs +src/models/pull_request_creation.rs +src/models/pull_requests_list.rs src/models/range_metadata.rs src/models/ref_list.rs src/models/refs_dump.rs diff --git a/clients/rust/README.md b/clients/rust/README.md index d83931b787a..613ea0bc568 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -80,13 +80,18 @@ Class | Method | HTTP request | Description *ExperimentalApi* | [**abort_presign_multipart_upload**](docs/ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload *ExperimentalApi* | [**complete_presign_multipart_upload**](docs/ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request *ExperimentalApi* | [**create_presign_multipart_upload**](docs/ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +*ExperimentalApi* | [**create_pull_request**](docs/ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request *ExperimentalApi* | [**create_user_external_principal**](docs/ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +*ExperimentalApi* | [**delete_pull_request**](docs/ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request *ExperimentalApi* | [**delete_user_external_principal**](docs/ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExperimentalApi* | [**external_principal_login**](docs/ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator *ExperimentalApi* | [**get_external_principal**](docs/ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +*ExperimentalApi* | [**get_pull_request**](docs/ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request *ExperimentalApi* | [**hard_reset_branch**](docs/ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +*ExperimentalApi* | [**list_pull_requests**](docs/ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests *ExperimentalApi* | [**list_user_external_principals**](docs/ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user *ExperimentalApi* | [**sts_login**](docs/ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +*ExperimentalApi* | [**update_pull_request**](docs/ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *ExternalApi* | [**create_user_external_principal**](docs/ExternalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user *ExternalApi* | [**delete_user_external_principal**](docs/ExternalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user *ExternalApi* | [**external_principal_login**](docs/ExternalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator @@ -135,6 +140,11 @@ Class | Method | HTTP request | Description *ObjectsApi* | [**list_objects**](docs/ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix *ObjectsApi* | [**stat_object**](docs/ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata *ObjectsApi* | [**upload_object**](docs/ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | +*PullsApi* | [**create_pull_request**](docs/PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +*PullsApi* | [**delete_pull_request**](docs/PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +*PullsApi* | [**get_pull_request**](docs/PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +*PullsApi* | [**list_pull_requests**](docs/PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +*PullsApi* | [**update_pull_request**](docs/PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request *RefsApi* | [**diff_refs**](docs/RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references *RefsApi* | [**find_merge_base**](docs/RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references *RefsApi* | [**log_commits**](docs/RefsApi.md#log_commits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits. @@ -228,6 +238,10 @@ Class | Method | HTTP request | Description - [PrepareGcUncommittedRequest](docs/PrepareGcUncommittedRequest.md) - [PrepareGcUncommittedResponse](docs/PrepareGcUncommittedResponse.md) - [PresignMultipartUpload](docs/PresignMultipartUpload.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestBasic](docs/PullRequestBasic.md) + - [PullRequestCreation](docs/PullRequestCreation.md) + - [PullRequestsList](docs/PullRequestsList.md) - [RangeMetadata](docs/RangeMetadata.md) - [Ref](docs/Ref.md) - [RefList](docs/RefList.md) diff --git a/clients/rust/docs/ExperimentalApi.md b/clients/rust/docs/ExperimentalApi.md index 389837afa1e..04fc3644646 100644 --- a/clients/rust/docs/ExperimentalApi.md +++ b/clients/rust/docs/ExperimentalApi.md @@ -7,13 +7,18 @@ Method | HTTP request | Description [**abort_presign_multipart_upload**](ExperimentalApi.md#abort_presign_multipart_upload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload [**complete_presign_multipart_upload**](ExperimentalApi.md#complete_presign_multipart_upload) | **PUT** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Complete a presign multipart upload request [**create_presign_multipart_upload**](ExperimentalApi.md#create_presign_multipart_upload) | **POST** /repositories/{repository}/branches/{branch}/staging/pmpu | Initiate a multipart upload +[**create_pull_request**](ExperimentalApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request [**create_user_external_principal**](ExperimentalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user +[**delete_pull_request**](ExperimentalApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request [**delete_user_external_principal**](ExperimentalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user [**external_principal_login**](ExperimentalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator [**get_external_principal**](ExperimentalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id +[**get_pull_request**](ExperimentalApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request [**hard_reset_branch**](ExperimentalApi.md#hard_reset_branch) | **PUT** /repositories/{repository}/branches/{branch}/hard_reset | hard reset branch +[**list_pull_requests**](ExperimentalApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests [**list_user_external_principals**](ExperimentalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user [**sts_login**](ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS +[**update_pull_request**](ExperimentalApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request @@ -118,6 +123,35 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## create_pull_request + +> String create_pull_request(repository, pull_request_creation) +create pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md) | | [required] | + +### Return type + +**String** + +### Authorization + +[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 + +- **Content-Type**: application/json +- **Accept**: text/html, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## create_user_external_principal > create_user_external_principal(user_id, principal_id, external_principal_creation) @@ -148,6 +182,35 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## delete_pull_request + +> delete_pull_request(repository, pull_request) +delete pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## delete_user_external_principal > delete_user_external_principal(user_id, principal_id) @@ -233,6 +296,35 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_pull_request + +> models::PullRequest get_pull_request(repository, pull_request) +get pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | + +### Return type + +[**models::PullRequest**](PullRequest.md) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## hard_reset_branch > hard_reset_branch(repository, branch, r#ref, force) @@ -266,6 +358,38 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## list_pull_requests + +> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, state) +list pull requests + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**prefix** | Option<**String**> | return items prefixed with this value | | +**after** | Option<**String**> | return items after this value | | +**amount** | Option<**i32**> | how many items to return | |[default to 100] +**state** | Option<**String**> | | |[default to all] + +### Return type + +[**models::PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## list_user_external_principals > models::ExternalPrincipalList list_user_external_principals(user_id, prefix, after, amount) @@ -324,3 +448,33 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## update_pull_request + +> update_pull_request(repository, pull_request, pull_request_basic) +update pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | +**pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md) | | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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 + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/rust/docs/PullRequest.md b/clients/rust/docs/PullRequest.md new file mode 100644 index 00000000000..8de195d6192 --- /dev/null +++ b/clients/rust/docs/PullRequest.md @@ -0,0 +1,19 @@ +# PullRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**creation_date** | **i64** | | +**author** | **String** | | +**source_branch** | **String** | | +**destination_branch** | **String** | | +**commit_id** | Option<**String**> | the commit id of merged PRs | [optional] +**status** | **String** | | +**title** | **String** | | +**description** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/rust/docs/PullRequestBasic.md b/clients/rust/docs/PullRequestBasic.md new file mode 100644 index 00000000000..4b73ad0969e --- /dev/null +++ b/clients/rust/docs/PullRequestBasic.md @@ -0,0 +1,13 @@ +# PullRequestBasic + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/rust/docs/PullRequestCreation.md b/clients/rust/docs/PullRequestCreation.md new file mode 100644 index 00000000000..e4e088660fa --- /dev/null +++ b/clients/rust/docs/PullRequestCreation.md @@ -0,0 +1,14 @@ +# PullRequestCreation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | +**description** | **String** | | +**source_branch** | **String** | | +**destination_branch** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/rust/docs/PullRequestsList.md b/clients/rust/docs/PullRequestsList.md new file mode 100644 index 00000000000..03229732b27 --- /dev/null +++ b/clients/rust/docs/PullRequestsList.md @@ -0,0 +1,12 @@ +# PullRequestsList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**models::Pagination**](Pagination.md) | | +**results** | [**Vec**](PullRequest.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/rust/docs/PullsApi.md b/clients/rust/docs/PullsApi.md new file mode 100644 index 00000000000..1c90ac01427 --- /dev/null +++ b/clients/rust/docs/PullsApi.md @@ -0,0 +1,162 @@ +# \PullsApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_pull_request**](PullsApi.md#create_pull_request) | **POST** /repositories/{repository}/pulls | create pull request +[**delete_pull_request**](PullsApi.md#delete_pull_request) | **DELETE** /repositories/{repository}/pulls/{pull_request} | delete pull request +[**get_pull_request**](PullsApi.md#get_pull_request) | **GET** /repositories/{repository}/pulls/{pull_request} | get pull request +[**list_pull_requests**](PullsApi.md#list_pull_requests) | **GET** /repositories/{repository}/pulls | list pull requests +[**update_pull_request**](PullsApi.md#update_pull_request) | **PATCH** /repositories/{repository}/pulls/{pull_request} | update pull request + + + +## create_pull_request + +> String create_pull_request(repository, pull_request_creation) +create pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request_creation** | [**PullRequestCreation**](PullRequestCreation.md) | | [required] | + +### Return type + +**String** + +### Authorization + +[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 + +- **Content-Type**: application/json +- **Accept**: text/html, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_pull_request + +> delete_pull_request(repository, pull_request) +delete pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_pull_request + +> models::PullRequest get_pull_request(repository, pull_request) +get pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | + +### Return type + +[**models::PullRequest**](PullRequest.md) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_pull_requests + +> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, state) +list pull requests + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**prefix** | Option<**String**> | return items prefixed with this value | | +**after** | Option<**String**> | return items after this value | | +**amount** | Option<**i32**> | how many items to return | |[default to 100] +**state** | Option<**String**> | | |[default to all] + +### Return type + +[**models::PullRequestsList**](PullRequestsList.md) + +### Authorization + +[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 + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_pull_request + +> update_pull_request(repository, pull_request, pull_request_basic) +update pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**pull_request** | **String** | pull request id | [required] | +**pull_request_basic** | [**PullRequestBasic**](PullRequestBasic.md) | | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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 + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/rust/src/apis/experimental_api.rs b/clients/rust/src/apis/experimental_api.rs index 02eac5b4088..f50f7483f68 100644 --- a/clients/rust/src/apis/experimental_api.rs +++ b/clients/rust/src/apis/experimental_api.rs @@ -52,6 +52,20 @@ pub enum CreatePresignMultipartUploadError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`create_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreatePullRequestError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status409(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`create_user_external_principal`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -64,6 +78,18 @@ pub enum CreateUserExternalPrincipalError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`delete_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePullRequestError { + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`delete_user_external_principal`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -99,6 +125,17 @@ pub enum GetExternalPrincipalError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPullRequestError { + Status401(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`hard_reset_branch`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -112,6 +149,17 @@ pub enum HardResetBranchError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`list_pull_requests`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPullRequestsError { + Status401(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`list_user_external_principals`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -133,6 +181,18 @@ pub enum StsLoginError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePullRequestError { + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// Aborts a presign multipart upload. pub async fn abort_presign_multipart_upload(configuration: &configuration::Configuration, repository: &str, branch: &str, upload_id: &str, path: &str, abort_presign_multipart_upload: Option) -> Result<(), Error> { @@ -244,6 +304,40 @@ pub async fn create_presign_multipart_upload(configuration: &configuration::Conf } } +pub async fn create_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request_creation: models::PullRequestCreation) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls", local_var_configuration.base_path, repository=crate::apis::urlencode(repository)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&pull_request_creation); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn create_user_external_principal(configuration: &configuration::Configuration, user_id: &str, principal_id: &str, external_principal_creation: Option) -> Result<(), Error> { let local_var_configuration = configuration; @@ -279,6 +373,39 @@ pub async fn create_user_external_principal(configuration: &configuration::Confi } } +pub async fn delete_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn delete_user_external_principal(configuration: &configuration::Configuration, user_id: &str, principal_id: &str) -> Result<(), Error> { let local_var_configuration = configuration; @@ -375,6 +502,39 @@ pub async fn get_external_principal(configuration: &configuration::Configuration } } +pub async fn get_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Relocate branch to refer to ref. Branch must not contain uncommitted data. pub async fn hard_reset_branch(configuration: &configuration::Configuration, repository: &str, branch: &str, r#ref: &str, force: Option) -> Result<(), Error> { let local_var_configuration = configuration; @@ -413,6 +573,51 @@ pub async fn hard_reset_branch(configuration: &configuration::Configuration, rep } } +pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, state: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls", local_var_configuration.base_path, repository=crate::apis::urlencode(repository)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = prefix { + local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = after { + local_var_req_builder = local_var_req_builder.query(&[("after", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = amount { + local_var_req_builder = local_var_req_builder.query(&[("amount", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn list_user_external_principals(configuration: &configuration::Configuration, user_id: &str, prefix: Option<&str>, after: Option<&str>, amount: Option) -> Result> { let local_var_configuration = configuration; @@ -483,3 +688,37 @@ pub async fn sts_login(configuration: &configuration::Configuration, sts_auth_re } } +pub async fn update_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str, pull_request_basic: models::PullRequestBasic) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&pull_request_basic); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/clients/rust/src/apis/mod.rs b/clients/rust/src/apis/mod.rs index 97ab8293244..190c1def9f2 100644 --- a/clients/rust/src/apis/mod.rs +++ b/clients/rust/src/apis/mod.rs @@ -102,6 +102,7 @@ pub mod import_api; pub mod internal_api; pub mod metadata_api; pub mod objects_api; +pub mod pulls_api; pub mod refs_api; pub mod repositories_api; pub mod staging_api; diff --git a/clients/rust/src/apis/pulls_api.rs b/clients/rust/src/apis/pulls_api.rs new file mode 100644 index 00000000000..ce1498ef760 --- /dev/null +++ b/clients/rust/src/apis/pulls_api.rs @@ -0,0 +1,257 @@ +/* + * lakeFS API + * + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: services@treeverse.io + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreatePullRequestError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status409(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePullRequestError { + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPullRequestError { + Status401(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_pull_requests`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPullRequestsError { + Status401(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePullRequestError { + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status420(), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn create_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request_creation: models::PullRequestCreation) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls", local_var_configuration.base_path, repository=crate::apis::urlencode(repository)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&pull_request_creation); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn delete_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, state: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls", local_var_configuration.base_path, repository=crate::apis::urlencode(repository)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = prefix { + local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = after { + local_var_req_builder = local_var_req_builder.query(&[("after", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = amount { + local_var_req_builder = local_var_req_builder.query(&[("amount", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn update_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str, pull_request_basic: models::PullRequestBasic) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/pulls/{pull_request}", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), pull_request=crate::apis::urlencode(pull_request)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&pull_request_basic); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/clients/rust/src/models/mod.rs b/clients/rust/src/models/mod.rs index 3e24d05fc5b..2308e47522c 100644 --- a/clients/rust/src/models/mod.rs +++ b/clients/rust/src/models/mod.rs @@ -128,6 +128,14 @@ pub mod prepare_gc_uncommitted_response; pub use self::prepare_gc_uncommitted_response::PrepareGcUncommittedResponse; pub mod presign_multipart_upload; pub use self::presign_multipart_upload::PresignMultipartUpload; +pub mod pull_request; +pub use self::pull_request::PullRequest; +pub mod pull_request_basic; +pub use self::pull_request_basic::PullRequestBasic; +pub mod pull_request_creation; +pub use self::pull_request_creation::PullRequestCreation; +pub mod pull_requests_list; +pub use self::pull_requests_list::PullRequestsList; pub mod range_metadata; pub use self::range_metadata::RangeMetadata; pub mod model_ref; diff --git a/clients/rust/src/models/pull_request.rs b/clients/rust/src/models/pull_request.rs new file mode 100644 index 00000000000..f1c703914bd --- /dev/null +++ b/clients/rust/src/models/pull_request.rs @@ -0,0 +1,67 @@ +/* + * lakeFS API + * + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: services@treeverse.io + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PullRequest { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "creation_date")] + pub creation_date: i64, + #[serde(rename = "author")] + pub author: String, + #[serde(rename = "source_branch")] + pub source_branch: String, + #[serde(rename = "destination_branch")] + pub destination_branch: String, + /// the commit id of merged PRs + #[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")] + pub commit_id: Option, + #[serde(rename = "status")] + pub status: Status, + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description")] + pub description: String, +} + +impl PullRequest { + pub fn new(id: String, creation_date: i64, author: String, source_branch: String, destination_branch: String, status: Status, title: String, description: String) -> PullRequest { + PullRequest { + id, + creation_date, + author, + source_branch, + destination_branch, + commit_id: None, + status, + title, + description, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "open")] + Open, + #[serde(rename = "closed")] + Closed, + #[serde(rename = "merged")] + Merged, +} + +impl Default for Status { + fn default() -> Status { + Self::Open + } +} + diff --git a/clients/rust/src/models/pull_request_basic.rs b/clients/rust/src/models/pull_request_basic.rs new file mode 100644 index 00000000000..71c7468e662 --- /dev/null +++ b/clients/rust/src/models/pull_request_basic.rs @@ -0,0 +1,48 @@ +/* + * lakeFS API + * + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: services@treeverse.io + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PullRequestBasic { + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl PullRequestBasic { + pub fn new() -> PullRequestBasic { + PullRequestBasic { + status: None, + title: None, + description: None, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "open")] + Open, + #[serde(rename = "closed")] + Closed, + #[serde(rename = "merged")] + Merged, +} + +impl Default for Status { + fn default() -> Status { + Self::Open + } +} + diff --git a/clients/rust/src/models/pull_request_creation.rs b/clients/rust/src/models/pull_request_creation.rs new file mode 100644 index 00000000000..2f4c10d2a22 --- /dev/null +++ b/clients/rust/src/models/pull_request_creation.rs @@ -0,0 +1,35 @@ +/* + * lakeFS API + * + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: services@treeverse.io + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PullRequestCreation { + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "source_branch")] + pub source_branch: String, + #[serde(rename = "destination_branch")] + pub destination_branch: String, +} + +impl PullRequestCreation { + pub fn new(title: String, description: String, source_branch: String, destination_branch: String) -> PullRequestCreation { + PullRequestCreation { + title, + description, + source_branch, + destination_branch, + } + } +} + diff --git a/clients/rust/src/models/pull_requests_list.rs b/clients/rust/src/models/pull_requests_list.rs new file mode 100644 index 00000000000..ddd65290d68 --- /dev/null +++ b/clients/rust/src/models/pull_requests_list.rs @@ -0,0 +1,29 @@ +/* + * lakeFS API + * + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: services@treeverse.io + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PullRequestsList { + #[serde(rename = "pagination")] + pub pagination: Box, + #[serde(rename = "results")] + pub results: Vec, +} + +impl PullRequestsList { + pub fn new(pagination: models::Pagination, results: Vec) -> PullRequestsList { + PullRequestsList { + pagination: Box::new(pagination), + results, + } + } +} + diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index c01acb17ee2..c941675019f 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -1729,6 +1729,77 @@ components: type: object items: $ref: "#/components/schemas/ExternalPrincipalSettings" + + PullRequestBasic: + type: object + properties: + status: + type: string + enum: [ open, closed, merged ] + title: + type: string + description: + type: string + + PullRequest: + type: object + required: + - id + - status + - creation_date + - title + - author + - description + - source_branch + - destination_branch + allOf: + - $ref: '#/components/schemas/PullRequestBasic' + properties: + id: + type: string + creation_date: + type: integer + format: int64 + author: + type: string + source_branch: + type: string + destination_branch: + type: string + commit_id: + type: string + description: the commit id of merged PRs + + PullRequestsList: + type: object + required: + - pagination + - results + properties: + pagination: + $ref: "#/components/schemas/Pagination" + results: + type: array + items: + $ref: "#/components/schemas/PullRequest" + + PullRequestCreation: + type: object + required: + - title + - description + - source_branch + - destination_branch + properties: + title: + type: string + description: + type: string + source_branch: + type: string + destination_branch: + type: string + paths: /setup_comm_prefs: post: @@ -5582,6 +5653,159 @@ paths: description: too many requests default: $ref: "#/components/responses/ServerError" + + /repositories/{repository}/pulls: + parameters: + - in: path + name: repository + required: true + schema: + type: string + get: + tags: + - pulls + - experimental + operationId: listPullRequests + summary: list pull requests + parameters: + - $ref: "#/components/parameters/PaginationPrefix" + - $ref: "#/components/parameters/PaginationAfter" + - $ref: "#/components/parameters/PaginationAmount" + - in: query + name: state + schema: + type: string + enum: [ open, closed, all ] + default: all + description: filter pull requests by state + responses: + 200: + description: list of pull requests + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestsList" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + post: + tags: + - pulls + - experimental + operationId: createPullRequest + summary: create pull request + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestCreation" + responses: + 201: + description: pull request id + content: + text/html: + schema: + type: string + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 409: + $ref: "#/components/responses/Conflict" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + + /repositories/{repository}/pulls/{pull_request}: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: pull_request + required: true + description: pull request id + schema: + type: string + get: + tags: + - pulls + - experimental + operationId: getPullRequest + summary: get pull request + responses: + 200: + description: pull request + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequest" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + delete: + tags: + - pulls + - experimental + operationId: deletePullRequest + summary: delete pull request + responses: + 204: + description: pull request deleted successfully + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + patch: + tags: + - pulls + - experimental + operationId: updatePullRequest + summary: update pull request + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PullRequestBasic" + responses: + 204: + description: pull request deleted successfully + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 420: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + /healthcheck: get: operationId: healthCheck diff --git a/pkg/api/controller.go b/pkg/api/controller.go index b463627c1b3..b1f259d3fb0 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -5176,6 +5176,26 @@ func (c *Controller) PostStatsEvents(w http.ResponseWriter, r *http.Request, bod writeResponse(w, r, http.StatusNoContent, nil) } +func (c *Controller) ListPullRequests(w http.ResponseWriter, r *http.Request, repository string, params apigen.ListPullRequestsParams) { + writeResponse(w, r, http.StatusNotImplemented, nil) +} + +func (c *Controller) CreatePullRequest(w http.ResponseWriter, r *http.Request, body apigen.CreatePullRequestJSONRequestBody, repository string) { + writeResponse(w, r, http.StatusNotImplemented, nil) +} + +func (c *Controller) DeletePullRequest(w http.ResponseWriter, r *http.Request, repository string, pullRequestID string) { + writeResponse(w, r, http.StatusNotImplemented, nil) +} + +func (c *Controller) GetPullRequest(w http.ResponseWriter, r *http.Request, repository string, pullRequestID string) { + writeResponse(w, r, http.StatusNotImplemented, nil) +} + +func (c *Controller) UpdatePullRequest(w http.ResponseWriter, r *http.Request, body apigen.UpdatePullRequestJSONRequestBody, repository string, pullRequestID string) { + writeResponse(w, r, http.StatusNotImplemented, nil) +} + func writeError(w http.ResponseWriter, r *http.Request, code int, v interface{}) { apiErr := apigen.Error{ Message: fmt.Sprint(v),