diff --git a/api/swagger.yml b/api/swagger.yml index 56f17ab4cb6..4d32d245bc1 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -1581,6 +1581,46 @@ components: - completed - update_time + AsyncTaskStatus: + type: object + properties: + task_id: + type: string + description: the id of the async task + completed: + type: boolean + description: true if the task has completed (either successfully or with an error) + update_time: + type: string + format: date-time + description: last time the task status was updated + error: + $ref: "#/components/schemas/Error" + status_code: + type: integer + format: int32 + description: an http status code that correlates with the underlying error if exists + required: + - task_id + - completed + - update_time + + MergeAsyncStatus: + allOf: + - $ref: "#/components/schemas/AsyncTaskStatus" + - type: object + properties: + result: + $ref: "#/components/schemas/MergeResult" + + CommitAsyncStatus: + allOf: + - $ref: "#/components/schemas/AsyncTaskStatus" + - type: object + properties: + result: + $ref: "#/components/schemas/Commit" + PrepareGCUncommittedRequest: type: object properties: @@ -4237,13 +4277,110 @@ paths: 409: $ref: "#/components/responses/Conflict" 412: - description: Precondition Failed (e.g. a pre-commit hook returned a failure) + $ref: "#/components/responses/PreconditionFailed" + 429: + description: too many requests + default: + $ref: "#/components/responses/ServerError" + + /repositories/{repository}/branches/{branch}/commits/async: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: branch + required: true + schema: + type: string + post: + parameters: + - in: query + name: source_metarange + required: false + description: The source metarange to commit. Branch must not have uncommitted changes. + schema: + type: string + tags: + - experimental + operationId: commitAsync + summary: create commit asynchronously + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommitCreation" + responses: + 202: + description: commit task started content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: "#/components/schemas/TaskCreation" + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 429: + description: too many requests + 501: + $ref: "#/components/responses/NotImplemented" + default: + $ref: "#/components/responses/ServerError" + + /repositories/{repository}/branches/{branch}/commits/async/{id}/status: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: branch + required: true + schema: + type: string + - in: path + name: id + required: true + description: Unique identifier of the commit async task + schema: + type: string + get: + tags: + - experimental + operationId: commitAsyncStatus + summary: get status of async commit operation + responses: + 200: + description: commit task status + content: + application/json: + schema: + $ref: "#/components/schemas/CommitAsyncStatus" + 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" + 412: + $ref: "#/components/responses/PreconditionFailed" 429: description: too many requests + 501: + $ref: "#/components/responses/NotImplemented" default: $ref: "#/components/responses/ServerError" @@ -4596,6 +4733,113 @@ paths: default: $ref: "#/components/responses/ServerError" + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: sourceRef + required: true + schema: + type: string + description: source ref + - in: path + name: destinationBranch + required: true + schema: + type: string + description: destination branch name + post: + tags: + - experimental + operationId: mergeIntoBranchAsync + summary: merge references asynchronously + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Merge" + responses: + 202: + description: merge task started + content: + application/json: + schema: + $ref: "#/components/schemas/TaskCreation" + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFound" + 429: + description: too many requests + 501: + $ref: "#/components/responses/NotImplemented" + default: + $ref: "#/components/responses/ServerError" + + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: sourceRef + required: true + schema: + type: string + description: source ref + - in: path + name: destinationBranch + required: true + schema: + type: string + description: destination branch name + - in: path + name: id + required: true + description: Unique identifier of the merge async task + schema: + type: string + get: + tags: + - experimental + operationId: mergeIntoBranchAsyncStatus + summary: get status of async merge operation + responses: + 200: + description: merge task status + content: + application/json: + schema: + $ref: "#/components/schemas/MergeAsyncStatus" + 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" + 412: + $ref: "#/components/responses/PreconditionFailed" + 429: + description: too many requests + 501: + $ref: "#/components/responses/NotImplemented" + default: + $ref: "#/components/responses/ServerError" + /repositories/{repository}/branches/{branch}/diff: parameters: - $ref: "#/components/parameters/PaginationAfter" @@ -6701,7 +6945,7 @@ paths: schema: $ref: "#/components/schemas/MergeResult" 412: - description: precondition failed (e.g. a pre-merge hook returned a failure) + description: precondition failed content: application/json: schema: diff --git a/clients/java/README.md b/clients/java/README.md index ce4572f595b..91e702992c7 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -199,6 +199,8 @@ Class | Method | HTTP request | Description *CommitsApi* | [**getCommit**](docs/CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit *ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /config | *ExperimentalApi* | [**abortPresignMultipartUpload**](docs/ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload +*ExperimentalApi* | [**commitAsync**](docs/ExperimentalApi.md#commitAsync) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously +*ExperimentalApi* | [**commitAsyncStatus**](docs/ExperimentalApi.md#commitAsyncStatus) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation *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 @@ -213,6 +215,8 @@ Class | Method | HTTP request | Description *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* | [**mergeIntoBranchAsync**](docs/ExperimentalApi.md#mergeIntoBranchAsync) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously +*ExperimentalApi* | [**mergeIntoBranchAsyncStatus**](docs/ExperimentalApi.md#mergeIntoBranchAsyncStatus) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation *ExperimentalApi* | [**mergePullRequest**](docs/ExperimentalApi.md#mergePullRequest) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request *ExperimentalApi* | [**releaseTokenToMailbox**](docs/ExperimentalApi.md#releaseTokenToMailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. *ExperimentalApi* | [**stsLogin**](docs/ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS @@ -312,6 +316,7 @@ Class | Method | HTTP request | Description - [AccessKeyCredentials](docs/AccessKeyCredentials.md) - [ActionRun](docs/ActionRun.md) - [ActionRunList](docs/ActionRunList.md) + - [AsyncTaskStatus](docs/AsyncTaskStatus.md) - [AuthCapabilities](docs/AuthCapabilities.md) - [AuthenticationToken](docs/AuthenticationToken.md) - [BranchCreation](docs/BranchCreation.md) @@ -319,6 +324,7 @@ Class | Method | HTTP request | Description - [CherryPickCreation](docs/CherryPickCreation.md) - [CommPrefsInput](docs/CommPrefsInput.md) - [Commit](docs/Commit.md) + - [CommitAsyncStatus](docs/CommitAsyncStatus.md) - [CommitCreation](docs/CommitCreation.md) - [CommitList](docs/CommitList.md) - [CommitOverrides](docs/CommitOverrides.md) @@ -364,6 +370,7 @@ Class | Method | HTTP request | Description - [LoginConfig](docs/LoginConfig.md) - [LoginInformation](docs/LoginInformation.md) - [Merge](docs/Merge.md) + - [MergeAsyncStatus](docs/MergeAsyncStatus.md) - [MergeResult](docs/MergeResult.md) - [MetaRangeCreation](docs/MetaRangeCreation.md) - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 1a1429db0de..39b3e27d999 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -3891,7 +3891,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Precondition Failed (e.g. a pre-commit hook returned a failure) + description: Precondition Failed "429": description: too many requests default: @@ -3905,6 +3905,176 @@ paths: - commits x-content-type: application/json x-accepts: application/json + /repositories/{repository}/branches/{branch}/commits/async: + post: + operationId: commitAsync + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: The source metarange to commit. Branch must not have uncommitted + changes. + explode: true + in: query + name: source_metarange + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitCreation' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/TaskCreation' + description: commit task started + "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 + "429": + description: too many requests + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Implemented + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: create commit asynchronously + tags: + - experimental + x-content-type: application/json + x-accepts: application/json + /repositories/{repository}/branches/{branch}/commits/async/{id}/status: + get: + operationId: commitAsyncStatus + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + - description: Unique identifier of the commit async task + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CommitAsyncStatus' + description: commit task status + "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 + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed + "429": + description: too many requests + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Implemented + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get status of async commit operation + tags: + - experimental + x-accepts: application/json /repositories/{repository}/commits: post: operationId: CreateCommitRecord @@ -4516,6 +4686,184 @@ paths: - refs x-content-type: application/json x-accepts: application/json + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async: + post: + operationId: mergeIntoBranchAsync + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: source ref + explode: false + in: path + name: sourceRef + required: true + schema: + type: string + style: simple + - description: destination branch name + explode: false + in: path + name: destinationBranch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Merge' + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/TaskCreation' + description: merge task started + "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 + "429": + description: too many requests + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Implemented + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: merge references asynchronously + tags: + - experimental + x-content-type: application/json + x-accepts: application/json + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status: + get: + operationId: mergeIntoBranchAsyncStatus + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - description: source ref + explode: false + in: path + name: sourceRef + required: true + schema: + type: string + style: simple + - description: destination branch name + explode: false + in: path + name: destinationBranch + required: true + schema: + type: string + style: simple + - description: Unique identifier of the merge async task + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MergeAsyncStatus' + description: merge task status + "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 + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Precondition Failed + "429": + description: too many requests + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Implemented + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: get status of async merge operation + tags: + - experimental + x-accepts: application/json /repositories/{repository}/branches/{branch}/diff: get: operationId: diffBranch @@ -8188,7 +8536,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: precondition failed (e.g. a pre-merge hook returned a failure) + description: precondition failed "429": description: too many requests default: @@ -10772,6 +11120,45 @@ components: - task_id - update_time type: object + AsyncTaskStatus: + properties: + task_id: + description: the id of the async task + type: string + completed: + description: true if the task has completed (either successfully or with + an error) + type: boolean + update_time: + description: last time the task status was updated + format: date-time + type: string + error: + $ref: '#/components/schemas/Error' + status_code: + description: an http status code that correlates with the underlying error + if exists + format: int32 + type: integer + required: + - completed + - task_id + - update_time + type: object + MergeAsyncStatus: + allOf: + - $ref: '#/components/schemas/AsyncTaskStatus' + - properties: + result: + $ref: '#/components/schemas/MergeResult' + type: object + CommitAsyncStatus: + allOf: + - $ref: '#/components/schemas/AsyncTaskStatus' + - properties: + result: + $ref: '#/components/schemas/Commit' + type: object PrepareGCUncommittedRequest: example: continuation_token: continuation_token diff --git a/clients/java/docs/AsyncTaskStatus.md b/clients/java/docs/AsyncTaskStatus.md new file mode 100644 index 00000000000..8abb243619f --- /dev/null +++ b/clients/java/docs/AsyncTaskStatus.md @@ -0,0 +1,17 @@ + + +# AsyncTaskStatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskId** | **String** | the id of the async task | | +|**completed** | **Boolean** | true if the task has completed (either successfully or with an error) | | +|**updateTime** | **OffsetDateTime** | last time the task status was updated | | +|**error** | [**Error**](Error.md) | | [optional] | +|**statusCode** | **Integer** | an http status code that correlates with the underlying error if exists | [optional] | + + + diff --git a/clients/java/docs/CommitAsyncStatus.md b/clients/java/docs/CommitAsyncStatus.md new file mode 100644 index 00000000000..30da7bf93ec --- /dev/null +++ b/clients/java/docs/CommitAsyncStatus.md @@ -0,0 +1,18 @@ + + +# CommitAsyncStatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskId** | **String** | the id of the async task | | +|**completed** | **Boolean** | true if the task has completed (either successfully or with an error) | | +|**updateTime** | **OffsetDateTime** | last time the task status was updated | | +|**error** | [**Error**](Error.md) | | [optional] | +|**statusCode** | **Integer** | an http status code that correlates with the underlying error if exists | [optional] | +|**result** | [**Commit**](Commit.md) | | [optional] | + + + diff --git a/clients/java/docs/CommitsApi.md b/clients/java/docs/CommitsApi.md index cd73fec72df..470766a472b 100644 --- a/clients/java/docs/CommitsApi.md +++ b/clients/java/docs/CommitsApi.md @@ -108,7 +108,7 @@ public class Example { | **403** | Forbidden | - | | **404** | Resource Not Found | - | | **409** | Resource Conflicts With Target | - | -| **412** | Precondition Failed (e.g. a pre-commit hook returned a failure) | - | +| **412** | Precondition Failed | - | | **429** | too many requests | - | | **0** | Internal Server Error | - | diff --git a/clients/java/docs/ExperimentalApi.md b/clients/java/docs/ExperimentalApi.md index f58792f2444..08a8924bc16 100644 --- a/clients/java/docs/ExperimentalApi.md +++ b/clients/java/docs/ExperimentalApi.md @@ -5,6 +5,8 @@ All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**abortPresignMultipartUpload**](ExperimentalApi.md#abortPresignMultipartUpload) | **DELETE** /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId} | Abort a presign multipart upload | +| [**commitAsync**](ExperimentalApi.md#commitAsync) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously | +| [**commitAsyncStatus**](ExperimentalApi.md#commitAsyncStatus) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation | | [**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 | @@ -19,6 +21,8 @@ All URIs are relative to */api/v1* | [**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 | +| [**mergeIntoBranchAsync**](ExperimentalApi.md#mergeIntoBranchAsync) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously | +| [**mergeIntoBranchAsyncStatus**](ExperimentalApi.md#mergeIntoBranchAsyncStatus) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation | | [**mergePullRequest**](ExperimentalApi.md#mergePullRequest) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request | | [**releaseTokenToMailbox**](ExperimentalApi.md#releaseTokenToMailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. | | [**stsLogin**](ExperimentalApi.md#stsLogin) | **POST** /sts/login | perform a login with STS | @@ -132,6 +136,211 @@ null (empty response body) | **429** | too many requests | - | | **0** | Internal Server Error | - | + +# **commitAsync** +> TaskCreation commitAsync(repository, branch, commitCreation).sourceMetarange(sourceMetarange).execute(); + +create commit asynchronously + +### 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 branch = "branch_example"; // String | + CommitCreation commitCreation = new CommitCreation(); // CommitCreation | + String sourceMetarange = "sourceMetarange_example"; // String | The source metarange to commit. Branch must not have uncommitted changes. + try { + TaskCreation result = apiInstance.commitAsync(repository, branch, commitCreation) + .sourceMetarange(sourceMetarange) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#commitAsync"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **commitCreation** | [**CommitCreation**](CommitCreation.md)| | | +| **sourceMetarange** | **String**| The source metarange to commit. Branch must not have uncommitted changes. | [optional] | + +### Return type + +[**TaskCreation**](TaskCreation.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**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | commit task started | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **429** | too many requests | - | +| **501** | Not Implemented | - | +| **0** | Internal Server Error | - | + + +# **commitAsyncStatus** +> CommitAsyncStatus commitAsyncStatus(repository, branch, id).execute(); + +get status of async commit operation + +### 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 branch = "branch_example"; // String | + String id = "id_example"; // String | Unique identifier of the commit async task + try { + CommitAsyncStatus result = apiInstance.commitAsyncStatus(repository, branch, id) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#commitAsyncStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **id** | **String**| Unique identifier of the commit async task | | + +### Return type + +[**CommitAsyncStatus**](CommitAsyncStatus.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** | commit task status | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **412** | Precondition Failed | - | +| **429** | too many requests | - | +| **501** | Not Implemented | - | +| **0** | Internal Server Error | - | + # **completePresignMultipartUpload** > ObjectStats completePresignMultipartUpload(repository, branch, uploadId, path).completePresignMultipartUpload(completePresignMultipartUpload).execute(); @@ -1421,6 +1630,213 @@ public class Example { | **429** | too many requests | - | | **0** | Internal Server Error | - | + +# **mergeIntoBranchAsync** +> TaskCreation mergeIntoBranchAsync(repository, sourceRef, destinationBranch).merge(merge).execute(); + +merge references asynchronously + +### 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 sourceRef = "sourceRef_example"; // String | source ref + String destinationBranch = "destinationBranch_example"; // String | destination branch name + Merge merge = new Merge(); // Merge | + try { + TaskCreation result = apiInstance.mergeIntoBranchAsync(repository, sourceRef, destinationBranch) + .merge(merge) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#mergeIntoBranchAsync"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **sourceRef** | **String**| source ref | | +| **destinationBranch** | **String**| destination branch name | | +| **merge** | [**Merge**](Merge.md)| | [optional] | + +### Return type + +[**TaskCreation**](TaskCreation.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**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | merge task started | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **429** | too many requests | - | +| **501** | Not Implemented | - | +| **0** | Internal Server Error | - | + + +# **mergeIntoBranchAsyncStatus** +> MergeAsyncStatus mergeIntoBranchAsyncStatus(repository, sourceRef, destinationBranch, id).execute(); + +get status of async merge operation + +### 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 sourceRef = "sourceRef_example"; // String | source ref + String destinationBranch = "destinationBranch_example"; // String | destination branch name + String id = "id_example"; // String | Unique identifier of the merge async task + try { + MergeAsyncStatus result = apiInstance.mergeIntoBranchAsyncStatus(repository, sourceRef, destinationBranch, id) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentalApi#mergeIntoBranchAsyncStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **sourceRef** | **String**| source ref | | +| **destinationBranch** | **String**| destination branch name | | +| **id** | **String**| Unique identifier of the merge async task | | + +### Return type + +[**MergeAsyncStatus**](MergeAsyncStatus.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** | merge task status | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource Not Found | - | +| **409** | Resource Conflicts With Target | - | +| **412** | Precondition Failed | - | +| **429** | too many requests | - | +| **501** | Not Implemented | - | +| **0** | Internal Server Error | - | + # **mergePullRequest** > MergeResult mergePullRequest(repository, pullRequest).execute(); @@ -1516,7 +1932,7 @@ public class Example { | **403** | Forbidden | - | | **404** | Resource Not Found | - | | **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | -| **412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +| **412** | precondition failed | - | | **429** | too many requests | - | | **0** | Internal Server Error | - | diff --git a/clients/java/docs/MergeAsyncStatus.md b/clients/java/docs/MergeAsyncStatus.md new file mode 100644 index 00000000000..1b98be628a4 --- /dev/null +++ b/clients/java/docs/MergeAsyncStatus.md @@ -0,0 +1,18 @@ + + +# MergeAsyncStatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskId** | **String** | the id of the async task | | +|**completed** | **Boolean** | true if the task has completed (either successfully or with an error) | | +|**updateTime** | **OffsetDateTime** | last time the task status was updated | | +|**error** | [**Error**](Error.md) | | [optional] | +|**statusCode** | **Integer** | an http status code that correlates with the underlying error if exists | [optional] | +|**result** | [**MergeResult**](MergeResult.md) | | [optional] | + + + diff --git a/clients/java/docs/PullsApi.md b/clients/java/docs/PullsApi.md index b0580e55bc4..cc95817b1d1 100644 --- a/clients/java/docs/PullsApi.md +++ b/clients/java/docs/PullsApi.md @@ -406,7 +406,7 @@ public class Example { | **403** | Forbidden | - | | **404** | Resource Not Found | - | | **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | -| **412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +| **412** | precondition failed | - | | **429** | too many requests | - | | **0** | Internal Server Error | - | diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java index 9ba183e8f09..4941e21af41 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/CommitsApi.java @@ -197,7 +197,7 @@ public APIcommitRequest sourceMetarange(String sourceMetarange) { 403 Forbidden - 404 Resource Not Found - 409 Resource Conflicts With Target - - 412 Precondition Failed (e.g. a pre-commit hook returned a failure) - + 412 Precondition Failed - 429 too many requests - 0 Internal Server Error - @@ -219,7 +219,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Resource Conflicts With Target - - 412 Precondition Failed (e.g. a pre-commit hook returned a failure) - + 412 Precondition Failed - 429 too many requests - 0 Internal Server Error - @@ -242,7 +242,7 @@ public Commit execute() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Resource Conflicts With Target - - 412 Precondition Failed (e.g. a pre-commit hook returned a failure) - + 412 Precondition Failed - 429 too many requests - 0 Internal Server Error - @@ -265,7 +265,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Resource Conflicts With Target - - 412 Precondition Failed (e.g. a pre-commit hook returned a failure) - + 412 Precondition Failed - 429 too many requests - 0 Internal Server Error - @@ -291,7 +291,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws Api 403 Forbidden - 404 Resource Not Found - 409 Resource Conflicts With Target - - 412 Precondition Failed (e.g. a pre-commit hook returned a failure) - + 412 Precondition Failed - 429 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 e2dc7eebe1e..1ca633f882a 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 @@ -29,6 +29,8 @@ import io.lakefs.clients.sdk.model.AbortPresignMultipartUpload; import io.lakefs.clients.sdk.model.AuthenticationToken; +import io.lakefs.clients.sdk.model.CommitAsyncStatus; +import io.lakefs.clients.sdk.model.CommitCreation; import io.lakefs.clients.sdk.model.CompletePresignMultipartUpload; import io.lakefs.clients.sdk.model.Error; import io.lakefs.clients.sdk.model.ExternalLoginInformation; @@ -36,6 +38,8 @@ import io.lakefs.clients.sdk.model.ExternalPrincipalCreation; import io.lakefs.clients.sdk.model.ExternalPrincipalList; import io.lakefs.clients.sdk.model.License; +import io.lakefs.clients.sdk.model.Merge; +import io.lakefs.clients.sdk.model.MergeAsyncStatus; import io.lakefs.clients.sdk.model.MergeResult; import io.lakefs.clients.sdk.model.ObjectStats; import io.lakefs.clients.sdk.model.PresignMultipartUpload; @@ -46,6 +50,7 @@ import io.lakefs.clients.sdk.model.PullRequestsList; import io.lakefs.clients.sdk.model.StagingLocation; import io.lakefs.clients.sdk.model.StsAuthRequest; +import io.lakefs.clients.sdk.model.TaskCreation; import io.lakefs.clients.sdk.model.UpdateObjectUserMetadata; import io.lakefs.clients.sdk.model.UploadPartCopyFrom; import io.lakefs.clients.sdk.model.UploadPartFrom; @@ -309,7 +314,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiEx public APIabortPresignMultipartUploadRequest abortPresignMultipartUpload(String repository, String branch, String uploadId, String path) { return new APIabortPresignMultipartUploadRequest(repository, branch, uploadId, path); } - private okhttp3.Call completePresignMultipartUploadCall(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncCall(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -323,13 +328,12 @@ private okhttp3.Call completePresignMultipartUploadCall(String repository, Strin basePath = null; } - Object localVarPostBody = completePresignMultipartUpload; + Object localVarPostBody = commitCreation; // create path and map variables - String localVarPath = "/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}" + String localVarPath = "/repositories/{repository}/branches/{branch}/commits/async" .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) - .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())) - .replace("{" + "uploadId" + "}", localVarApiClient.escapeString(uploadId.toString())); + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -337,8 +341,8 @@ private okhttp3.Call completePresignMultipartUploadCall(String repository, Strin Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (path != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + if (sourceMetarange != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("source_metarange", sourceMetarange)); } final String[] localVarAccepts = { @@ -358,182 +362,179 @@ private okhttp3.Call completePresignMultipartUploadCall(String repository, 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call completePresignMultipartUploadValidateBeforeCall(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncValidateBeforeCall(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { - throw new ApiException("Missing the required parameter 'repository' when calling completePresignMultipartUpload(Async)"); + throw new ApiException("Missing the required parameter 'repository' when calling commitAsync(Async)"); } // verify the required parameter 'branch' is set if (branch == null) { - throw new ApiException("Missing the required parameter 'branch' when calling completePresignMultipartUpload(Async)"); - } - - // verify the required parameter 'uploadId' is set - if (uploadId == null) { - throw new ApiException("Missing the required parameter 'uploadId' when calling completePresignMultipartUpload(Async)"); + throw new ApiException("Missing the required parameter 'branch' when calling commitAsync(Async)"); } - // verify the required parameter 'path' is set - if (path == null) { - throw new ApiException("Missing the required parameter 'path' when calling completePresignMultipartUpload(Async)"); + // verify the required parameter 'commitCreation' is set + if (commitCreation == null) { + throw new ApiException("Missing the required parameter 'commitCreation' when calling commitAsync(Async)"); } - return completePresignMultipartUploadCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); + return commitAsyncCall(repository, branch, commitCreation, sourceMetarange, _callback); } - private ApiResponse completePresignMultipartUploadWithHttpInfo(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload) throws ApiException { - okhttp3.Call localVarCall = completePresignMultipartUploadValidateBeforeCall(repository, branch, uploadId, path, completePresignMultipartUpload, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse commitAsyncWithHttpInfo(String repository, String branch, CommitCreation commitCreation, String sourceMetarange) throws ApiException { + okhttp3.Call localVarCall = commitAsyncValidateBeforeCall(repository, branch, commitCreation, sourceMetarange, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call completePresignMultipartUploadAsync(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncAsync(String repository, String branch, CommitCreation commitCreation, String sourceMetarange, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = completePresignMultipartUploadValidateBeforeCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = commitAsyncValidateBeforeCall(repository, branch, commitCreation, sourceMetarange, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIcompletePresignMultipartUploadRequest { + public class APIcommitAsyncRequest { private final String repository; private final String branch; - private final String uploadId; - private final String path; - private CompletePresignMultipartUpload completePresignMultipartUpload; + private final CommitCreation commitCreation; + private String sourceMetarange; - private APIcompletePresignMultipartUploadRequest(String repository, String branch, String uploadId, String path) { + private APIcommitAsyncRequest(String repository, String branch, CommitCreation commitCreation) { this.repository = repository; this.branch = branch; - this.uploadId = uploadId; - this.path = path; + this.commitCreation = commitCreation; } /** - * Set completePresignMultipartUpload - * @param completePresignMultipartUpload (optional) - * @return APIcompletePresignMultipartUploadRequest + * Set sourceMetarange + * @param sourceMetarange The source metarange to commit. Branch must not have uncommitted changes. (optional) + * @return APIcommitAsyncRequest */ - public APIcompletePresignMultipartUploadRequest completePresignMultipartUpload(CompletePresignMultipartUpload completePresignMultipartUpload) { - this.completePresignMultipartUpload = completePresignMultipartUpload; + public APIcommitAsyncRequest sourceMetarange(String sourceMetarange) { + this.sourceMetarange = sourceMetarange; return this; } /** - * Build call for completePresignMultipartUpload + * Build call for commitAsync * @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 Presign multipart upload completed -
400 Bad Request -
202 commit task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 conflict with a commit, try here -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return completePresignMultipartUploadCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); + return commitAsyncCall(repository, branch, commitCreation, sourceMetarange, _callback); } /** - * Execute completePresignMultipartUpload request - * @return ObjectStats + * Execute commitAsync request + * @return TaskCreation * @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 Presign multipart upload completed -
400 Bad Request -
202 commit task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 conflict with a commit, try here -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ObjectStats execute() throws ApiException { - ApiResponse localVarResp = completePresignMultipartUploadWithHttpInfo(repository, branch, uploadId, path, completePresignMultipartUpload); + public TaskCreation execute() throws ApiException { + ApiResponse localVarResp = commitAsyncWithHttpInfo(repository, branch, commitCreation, sourceMetarange); return localVarResp.getData(); } /** - * Execute completePresignMultipartUpload request with HTTP info returned - * @return ApiResponse<ObjectStats> + * Execute commitAsync request with HTTP info returned + * @return ApiResponse<TaskCreation> * @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 Presign multipart upload completed -
400 Bad Request -
202 commit task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 conflict with a commit, try here -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return completePresignMultipartUploadWithHttpInfo(repository, branch, uploadId, path, completePresignMultipartUpload); + public ApiResponse executeWithHttpInfo() throws ApiException { + return commitAsyncWithHttpInfo(repository, branch, commitCreation, sourceMetarange); } /** - * Execute completePresignMultipartUpload request (asynchronously) + * Execute commitAsync 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 Presign multipart upload completed -
400 Bad Request -
202 commit task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 conflict with a commit, try here -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return completePresignMultipartUploadAsync(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return commitAsyncAsync(repository, branch, commitCreation, sourceMetarange, _callback); } } /** - * Complete a presign multipart upload request - * Completes a presign multipart upload by assembling the uploaded parts. + * create commit asynchronously + * * @param repository (required) * @param branch (required) - * @param uploadId (required) - * @param path relative to the branch (required) - * @return APIcompletePresignMultipartUploadRequest + * @param commitCreation (required) + * @return APIcommitAsyncRequest * @http.response.details - - + + + - +
Status Code Description Response Headers
200 Presign multipart upload completed -
400 Bad Request -
202 commit task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 conflict with a commit, try here -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIcompletePresignMultipartUploadRequest completePresignMultipartUpload(String repository, String branch, String uploadId, String path) { - return new APIcompletePresignMultipartUploadRequest(repository, branch, uploadId, path); + public APIcommitAsyncRequest commitAsync(String repository, String branch, CommitCreation commitCreation) { + return new APIcommitAsyncRequest(repository, branch, commitCreation); } - private okhttp3.Call createPresignMultipartUploadCall(String repository, String branch, String path, Integer parts, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncStatusCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -550,9 +551,10 @@ private okhttp3.Call createPresignMultipartUploadCall(String repository, String Object localVarPostBody = null; // create path and map variables - String localVarPath = "/repositories/{repository}/branches/{branch}/staging/pmpu" + String localVarPath = "/repositories/{repository}/branches/{branch}/commits/async/{id}/status" .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) - .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -560,14 +562,6 @@ private okhttp3.Call createPresignMultipartUploadCall(String repository, String Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (path != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); - } - - if (parts != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("parts", parts)); - } - final String[] localVarAccepts = { "application/json" }; @@ -584,169 +578,178 @@ private okhttp3.Call createPresignMultipartUploadCall(String repository, String } 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); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createPresignMultipartUploadValidateBeforeCall(String repository, String branch, String path, Integer parts, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncStatusValidateBeforeCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { - throw new ApiException("Missing the required parameter 'repository' when calling createPresignMultipartUpload(Async)"); + throw new ApiException("Missing the required parameter 'repository' when calling commitAsyncStatus(Async)"); } // verify the required parameter 'branch' is set if (branch == null) { - throw new ApiException("Missing the required parameter 'branch' when calling createPresignMultipartUpload(Async)"); + throw new ApiException("Missing the required parameter 'branch' when calling commitAsyncStatus(Async)"); } - // verify the required parameter 'path' is set - if (path == null) { - throw new ApiException("Missing the required parameter 'path' when calling createPresignMultipartUpload(Async)"); + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling commitAsyncStatus(Async)"); } - return createPresignMultipartUploadCall(repository, branch, path, parts, _callback); + return commitAsyncStatusCall(repository, branch, id, _callback); } - private ApiResponse createPresignMultipartUploadWithHttpInfo(String repository, String branch, String path, Integer parts) throws ApiException { - okhttp3.Call localVarCall = createPresignMultipartUploadValidateBeforeCall(repository, branch, path, parts, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse commitAsyncStatusWithHttpInfo(String repository, String branch, String id) throws ApiException { + okhttp3.Call localVarCall = commitAsyncStatusValidateBeforeCall(repository, branch, id, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call createPresignMultipartUploadAsync(String repository, String branch, String path, Integer parts, final ApiCallback _callback) throws ApiException { + private okhttp3.Call commitAsyncStatusAsync(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createPresignMultipartUploadValidateBeforeCall(repository, branch, path, parts, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = commitAsyncStatusValidateBeforeCall(repository, branch, id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIcreatePresignMultipartUploadRequest { + public class APIcommitAsyncStatusRequest { private final String repository; private final String branch; - private final String path; - private Integer parts; + private final String id; - private APIcreatePresignMultipartUploadRequest(String repository, String branch, String path) { + private APIcommitAsyncStatusRequest(String repository, String branch, String id) { this.repository = repository; this.branch = branch; - this.path = path; - } - - /** - * Set parts - * @param parts number of presigned URL parts required to upload (optional) - * @return APIcreatePresignMultipartUploadRequest - */ - public APIcreatePresignMultipartUploadRequest parts(Integer parts) { - this.parts = parts; - return this; + this.id = id; } /** - * Build call for createPresignMultipartUpload + * Build call for commitAsyncStatus * @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 Presign multipart upload initiated -
400 Bad Request -
200 commit task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return createPresignMultipartUploadCall(repository, branch, path, parts, _callback); + return commitAsyncStatusCall(repository, branch, id, _callback); } /** - * Execute createPresignMultipartUpload request - * @return PresignMultipartUpload + * Execute commitAsyncStatus request + * @return CommitAsyncStatus * @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 Presign multipart upload initiated -
400 Bad Request -
200 commit task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public PresignMultipartUpload execute() throws ApiException { - ApiResponse localVarResp = createPresignMultipartUploadWithHttpInfo(repository, branch, path, parts); + public CommitAsyncStatus execute() throws ApiException { + ApiResponse localVarResp = commitAsyncStatusWithHttpInfo(repository, branch, id); return localVarResp.getData(); } /** - * Execute createPresignMultipartUpload request with HTTP info returned - * @return ApiResponse<PresignMultipartUpload> + * Execute commitAsyncStatus request with HTTP info returned + * @return ApiResponse<CommitAsyncStatus> * @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 Presign multipart upload initiated -
400 Bad Request -
200 commit task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return createPresignMultipartUploadWithHttpInfo(repository, branch, path, parts); + public ApiResponse executeWithHttpInfo() throws ApiException { + return commitAsyncStatusWithHttpInfo(repository, branch, id); } /** - * Execute createPresignMultipartUpload request (asynchronously) + * Execute commitAsyncStatus 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 Presign multipart upload initiated -
400 Bad Request -
200 commit task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return createPresignMultipartUploadAsync(repository, branch, path, parts, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return commitAsyncStatusAsync(repository, branch, id, _callback); } } /** - * Initiate a multipart upload - * 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). + * get status of async commit operation + * * @param repository (required) * @param branch (required) - * @param path relative to the branch (required) - * @return APIcreatePresignMultipartUploadRequest + * @param id Unique identifier of the commit async task (required) + * @return APIcommitAsyncStatusRequest * @http.response.details - - + + + + + +
Status Code Description Response Headers
201 Presign multipart upload initiated -
400 Bad Request -
200 commit task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIcreatePresignMultipartUploadRequest createPresignMultipartUpload(String repository, String branch, String path) { - return new APIcreatePresignMultipartUploadRequest(repository, branch, path); + public APIcommitAsyncStatusRequest commitAsyncStatus(String repository, String branch, String id) { + return new APIcommitAsyncStatusRequest(repository, branch, id); } - private okhttp3.Call createPullRequestCall(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call completePresignMultipartUploadCall(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -760,11 +763,13 @@ private okhttp3.Call createPullRequestCall(String repository, PullRequestCreatio basePath = null; } - Object localVarPostBody = pullRequestCreation; + Object localVarPostBody = completePresignMultipartUpload; // create path and map variables - String localVarPath = "/repositories/{repository}/pulls" - .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + String localVarPath = "/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())) + .replace("{" + "uploadId" + "}", localVarApiClient.escapeString(uploadId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -772,6 +777,10 @@ private okhttp3.Call createPullRequestCall(String repository, PullRequestCreatio Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + final String[] localVarAccepts = { "application/json" }; @@ -789,160 +798,182 @@ private okhttp3.Call createPullRequestCall(String repository, PullRequestCreatio } 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); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createPullRequestValidateBeforeCall(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call completePresignMultipartUploadValidateBeforeCall(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, 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)"); + throw new ApiException("Missing the required parameter 'repository' when calling completePresignMultipartUpload(Async)"); } - // verify the required parameter 'pullRequestCreation' is set - if (pullRequestCreation == null) { - throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling completePresignMultipartUpload(Async)"); } - return createPullRequestCall(repository, pullRequestCreation, _callback); + // verify the required parameter 'uploadId' is set + if (uploadId == null) { + throw new ApiException("Missing the required parameter 'uploadId' when calling completePresignMultipartUpload(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling completePresignMultipartUpload(Async)"); + } + + return completePresignMultipartUploadCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); } - private ApiResponse createPullRequestWithHttpInfo(String repository, PullRequestCreation pullRequestCreation) throws ApiException { - okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse completePresignMultipartUploadWithHttpInfo(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload) throws ApiException { + okhttp3.Call localVarCall = completePresignMultipartUploadValidateBeforeCall(repository, branch, uploadId, path, completePresignMultipartUpload, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call completePresignMultipartUploadAsync(String repository, String branch, String uploadId, String path, CompletePresignMultipartUpload completePresignMultipartUpload, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createPullRequestValidateBeforeCall(repository, pullRequestCreation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = completePresignMultipartUploadValidateBeforeCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIcreatePullRequestRequest { + public class APIcompletePresignMultipartUploadRequest { private final String repository; - private final PullRequestCreation pullRequestCreation; + private final String branch; + private final String uploadId; + private final String path; + private CompletePresignMultipartUpload completePresignMultipartUpload; - private APIcreatePullRequestRequest(String repository, PullRequestCreation pullRequestCreation) { + private APIcompletePresignMultipartUploadRequest(String repository, String branch, String uploadId, String path) { this.repository = repository; - this.pullRequestCreation = pullRequestCreation; + this.branch = branch; + this.uploadId = uploadId; + this.path = path; } /** - * 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 - - - - - - + * Set completePresignMultipartUpload + * @param completePresignMultipartUpload (optional) + * @return APIcompletePresignMultipartUploadRequest + */ + public APIcompletePresignMultipartUploadRequest completePresignMultipartUpload(CompletePresignMultipartUpload completePresignMultipartUpload) { + this.completePresignMultipartUpload = completePresignMultipartUpload; + return this; + } + + /** + * Build call for completePresignMultipartUpload + * @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 created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
+ + + + - +
Status Code Description Response Headers
200 Presign multipart upload completed -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
409 conflict with a commit, try here -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return createPullRequestCall(repository, pullRequestCreation, _callback); + return completePresignMultipartUploadCall(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); } /** - * Execute createPullRequest request - * @return PullRequestCreationResponse + * Execute completePresignMultipartUpload request + * @return ObjectStats * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + - - +
Status Code Description Response Headers
201 pull request created -
400 Validation Error -
200 Presign multipart upload completed -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
409 conflict with a commit, try here -
429 too many requests -
0 Internal Server Error -
*/ - public PullRequestCreationResponse execute() throws ApiException { - ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + public ObjectStats execute() throws ApiException { + ApiResponse localVarResp = completePresignMultipartUploadWithHttpInfo(repository, branch, uploadId, path, completePresignMultipartUpload); return localVarResp.getData(); } /** - * Execute createPullRequest request with HTTP info returned - * @return ApiResponse<PullRequestCreationResponse> + * Execute completePresignMultipartUpload request with HTTP info returned + * @return ApiResponse<ObjectStats> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + - - +
Status Code Description Response Headers
201 pull request created -
400 Validation Error -
200 Presign multipart upload completed -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
409 conflict with a commit, try here -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return createPullRequestWithHttpInfo(repository, pullRequestCreation); + public ApiResponse executeWithHttpInfo() throws ApiException { + return completePresignMultipartUploadWithHttpInfo(repository, branch, uploadId, path, completePresignMultipartUpload); } /** - * Execute createPullRequest request (asynchronously) + * Execute completePresignMultipartUpload 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 created -
400 Validation Error -
200 Presign multipart upload completed -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
409 conflict with a commit, try here -
429 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return createPullRequestAsync(repository, pullRequestCreation, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return completePresignMultipartUploadAsync(repository, branch, uploadId, path, completePresignMultipartUpload, _callback); } } /** - * create pull request - * + * Complete a presign multipart upload request + * Completes a presign multipart upload by assembling the uploaded parts. * @param repository (required) - * @param pullRequestCreation (required) - * @return APIcreatePullRequestRequest + * @param branch (required) + * @param uploadId (required) + * @param path relative to the branch (required) + * @return APIcompletePresignMultipartUploadRequest * @http.response.details - - + + - - +
Status Code Description Response Headers
201 pull request created -
400 Validation Error -
200 Presign multipart upload completed -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
409 conflict with a commit, try here -
429 too many requests -
0 Internal Server Error -
*/ - public APIcreatePullRequestRequest createPullRequest(String repository, PullRequestCreation pullRequestCreation) { - return new APIcreatePullRequestRequest(repository, pullRequestCreation); + public APIcompletePresignMultipartUploadRequest completePresignMultipartUpload(String repository, String branch, String uploadId, String path) { + return new APIcompletePresignMultipartUploadRequest(repository, branch, uploadId, path); } - private okhttp3.Call createUserExternalPrincipalCall(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createPresignMultipartUploadCall(String repository, String branch, String path, Integer parts, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -956,11 +987,12 @@ private okhttp3.Call createUserExternalPrincipalCall(String userId, String princ basePath = null; } - Object localVarPostBody = externalPrincipalCreation; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/users/{userId}/external/principals" - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = "/repositories/{repository}/branches/{branch}/staging/pmpu" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -968,8 +1000,12 @@ 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)); + if (path != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path)); + } + + if (parts != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("parts", parts)); } final String[] localVarAccepts = { @@ -981,7 +1017,6 @@ private okhttp3.Call createUserExternalPrincipalCall(String userId, String princ } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -993,158 +1028,165 @@ 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 createPresignMultipartUploadValidateBeforeCall(String repository, String branch, String path, Integer parts, 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 createPresignMultipartUpload(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 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling createPresignMultipartUpload(Async)"); } - return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling createPresignMultipartUpload(Async)"); + } + + return createPresignMultipartUploadCall(repository, branch, path, parts, _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 createPresignMultipartUploadWithHttpInfo(String repository, String branch, String path, Integer parts) throws ApiException { + okhttp3.Call localVarCall = createPresignMultipartUploadValidateBeforeCall(repository, branch, path, parts, 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 createPresignMultipartUploadAsync(String repository, String branch, String path, Integer parts, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = createPresignMultipartUploadValidateBeforeCall(repository, branch, path, parts, _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; + public class APIcreatePresignMultipartUploadRequest { + private final String repository; + private final String branch; + private final String path; + private Integer parts; - private APIcreateUserExternalPrincipalRequest(String userId, String principalId) { - this.userId = userId; - this.principalId = principalId; + private APIcreatePresignMultipartUploadRequest(String repository, String branch, String path) { + this.repository = repository; + this.branch = branch; + this.path = path; } /** - * Set externalPrincipalCreation - * @param externalPrincipalCreation (optional) - * @return APIcreateUserExternalPrincipalRequest + * Set parts + * @param parts number of presigned URL parts required to upload (optional) + * @return APIcreatePresignMultipartUploadRequest */ - public APIcreateUserExternalPrincipalRequest externalPrincipalCreation(ExternalPrincipalCreation externalPrincipalCreation) { - this.externalPrincipalCreation = externalPrincipalCreation; + public APIcreatePresignMultipartUploadRequest parts(Integer parts) { + this.parts = parts; return this; } /** - * Build call for createUserExternalPrincipal + * Build call for createPresignMultipartUpload * @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 external principal attached successfully -
201 Presign multipart upload initiated -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); + return createPresignMultipartUploadCall(repository, branch, path, parts, _callback); } /** - * Execute createUserExternalPrincipal request + * Execute createPresignMultipartUpload request + * @return PresignMultipartUpload * @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 Presign multipart upload initiated -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public void execute() throws ApiException { - createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); + public PresignMultipartUpload execute() throws ApiException { + ApiResponse localVarResp = createPresignMultipartUploadWithHttpInfo(repository, branch, path, parts); + return localVarResp.getData(); } /** - * Execute createUserExternalPrincipal request with HTTP info returned - * @return ApiResponse<Void> + * Execute createPresignMultipartUpload request with HTTP info returned + * @return ApiResponse<PresignMultipartUpload> * @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 Presign multipart upload initiated -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); + public ApiResponse executeWithHttpInfo() throws ApiException { + return createPresignMultipartUploadWithHttpInfo(repository, branch, path, parts); } /** - * Execute createUserExternalPrincipal request (asynchronously) + * Execute createPresignMultipartUpload 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 Presign multipart upload initiated -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 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 createPresignMultipartUploadAsync(repository, branch, path, parts, _callback); } } /** - * attach external principal to user - * - * @param userId (required) - * @param principalId (required) - * @return APIcreateUserExternalPrincipalRequest + * Initiate a multipart upload + * 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). + * @param repository (required) + * @param branch (required) + * @param path relative to the branch (required) + * @return APIcreatePresignMultipartUploadRequest * @http.response.details - + -
Status Code Description Response Headers
201 external principal attached successfully -
201 Presign multipart upload initiated -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public APIcreateUserExternalPrincipalRequest createUserExternalPrincipal(String userId, String principalId) { - return new APIcreateUserExternalPrincipalRequest(userId, principalId); + public APIcreatePresignMultipartUploadRequest createPresignMultipartUpload(String repository, String branch, String path) { + return new APIcreatePresignMultipartUploadRequest(repository, branch, path); } - private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String principalId, 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[] { }; @@ -1158,11 +1200,11 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ basePath = null; } - Object localVarPostBody = null; + 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(); @@ -1170,10 +1212,6 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (principalId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("principalId", principalId)); - } - final String[] localVarAccepts = { "application/json" }; @@ -1183,6 +1221,7 @@ private okhttp3.Call deleteUserExternalPrincipalCall(String userId, String princ } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1190,146 +1229,160 @@ 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 { - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling deleteUserExternalPrincipal(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 deleteUserExternalPrincipal(Async)"); + // verify the required parameter 'pullRequestCreation' is set + if (pullRequestCreation == null) { + throw new ApiException("Missing the required parameter 'pullRequestCreation' when calling createPullRequest(Async)"); } - return deleteUserExternalPrincipalCall(userId, principalId, _callback); + return createPullRequestCall(repository, pullRequestCreation, _callback); } - private ApiResponse deleteUserExternalPrincipalWithHttpInfo(String userId, String principalId) throws ApiException { - okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, 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 deleteUserExternalPrincipalAsync(String userId, String principalId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createPullRequestAsync(String repository, PullRequestCreation pullRequestCreation, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, _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 APIdeleteUserExternalPrincipalRequest { - private final String userId; - private final String principalId; + public class APIcreatePullRequestRequest { + private final String repository; + private final PullRequestCreation pullRequestCreation; - private APIdeleteUserExternalPrincipalRequest(String userId, String principalId) { - this.userId = userId; - this.principalId = principalId; + private APIcreatePullRequestRequest(String repository, PullRequestCreation pullRequestCreation) { + this.repository = repository; + this.pullRequestCreation = pullRequestCreation; } /** - * Build call for deleteUserExternalPrincipal + * 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
204 external principal detached successfully -
400 Bad Request -
201 pull request created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return deleteUserExternalPrincipalCall(userId, principalId, _callback); + return createPullRequestCall(repository, pullRequestCreation, _callback); } /** - * Execute deleteUserExternalPrincipal request + * Execute createPullRequest request + * @return PullRequestCreationResponse * @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 -
400 Bad Request -
201 pull request created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public void execute() throws ApiException { - deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + public PullRequestCreationResponse execute() throws ApiException { + ApiResponse localVarResp = createPullRequestWithHttpInfo(repository, pullRequestCreation); + return localVarResp.getData(); } /** - * Execute deleteUserExternalPrincipal request with HTTP info returned - * @return ApiResponse<Void> + * Execute createPullRequest request with HTTP info returned + * @return ApiResponse<PullRequestCreationResponse> * @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 -
400 Bad Request -
201 pull request created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return deleteUserExternalPrincipalWithHttpInfo(userId, principalId); + public ApiResponse executeWithHttpInfo() throws ApiException { + return createPullRequestWithHttpInfo(repository, pullRequestCreation); } /** - * Execute deleteUserExternalPrincipal 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
204 external principal detached successfully -
400 Bad Request -
201 pull request created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return deleteUserExternalPrincipalAsync(userId, principalId, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return createPullRequestAsync(repository, pullRequestCreation, _callback); } } /** - * delete external principal from user + * create pull request * - * @param userId (required) - * @param principalId (required) - * @return APIdeleteUserExternalPrincipalRequest + * @param repository (required) + * @param pullRequestCreation (required) + * @return APIcreatePullRequestRequest * @http.response.details - - + + + +
Status Code Description Response Headers
204 external principal detached successfully -
400 Bad Request -
201 pull request created -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public APIdeleteUserExternalPrincipalRequest deleteUserExternalPrincipal(String userId, String principalId) { - return new APIdeleteUserExternalPrincipalRequest(userId, principalId); + public APIcreatePullRequestRequest createPullRequest(String repository, PullRequestCreation pullRequestCreation) { + return new APIcreatePullRequestRequest(repository, pullRequestCreation); } - private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externalLoginInformation, 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[] { }; @@ -1343,10 +1396,11 @@ private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externa basePath = null; } - Object localVarPostBody = externalLoginInformation; + Object localVarPostBody = externalPrincipalCreation; // create path and map variables - String localVarPath = "/auth/external/principal/login"; + String localVarPath = "/auth/users/{userId}/external/principals" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1354,6 +1408,10 @@ private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externa Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (principalId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("principalId", principalId)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1370,151 +1428,163 @@ private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externa localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { }; + 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 externalPrincipalLoginValidateBeforeCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { - return externalPrincipalLoginCall(externalLoginInformation, _callback); + 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)"); + } + + // verify the required parameter 'principalId' is set + if (principalId == null) { + throw new ApiException("Missing the required parameter 'principalId' when calling createUserExternalPrincipal(Async)"); + } + + return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _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 createUserExternalPrincipalWithHttpInfo(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation) throws ApiException { + okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, null); + return localVarApiClient.execute(localVarCall); } - private okhttp3.Call externalPrincipalLoginAsync(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserExternalPrincipalAsync(String userId, String principalId, ExternalPrincipalCreation externalPrincipalCreation, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = createUserExternalPrincipalValidateBeforeCall(userId, principalId, externalPrincipalCreation, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - public class APIexternalPrincipalLoginRequest { - private ExternalLoginInformation externalLoginInformation; + public class APIcreateUserExternalPrincipalRequest { + private final String userId; + private final String principalId; + private ExternalPrincipalCreation externalPrincipalCreation; - private APIexternalPrincipalLoginRequest() { + private APIcreateUserExternalPrincipalRequest(String userId, String principalId) { + this.userId = userId; + this.principalId = principalId; } /** - * Set externalLoginInformation - * @param externalLoginInformation (optional) - * @return APIexternalPrincipalLoginRequest + * Set externalPrincipalCreation + * @param externalPrincipalCreation (optional) + * @return APIcreateUserExternalPrincipalRequest */ - public APIexternalPrincipalLoginRequest externalLoginInformation(ExternalLoginInformation externalLoginInformation) { - this.externalLoginInformation = externalLoginInformation; + public APIcreateUserExternalPrincipalRequest externalPrincipalCreation(ExternalPrincipalCreation externalPrincipalCreation) { + this.externalPrincipalCreation = externalPrincipalCreation; return this; } /** - * Build call for externalPrincipalLogin + * 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
200 successful external login -
201 external principal attached successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return externalPrincipalLoginCall(externalLoginInformation, _callback); + return createUserExternalPrincipalCall(userId, principalId, externalPrincipalCreation, _callback); } /** - * Execute externalPrincipalLogin request - * @return AuthenticationToken + * 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
200 successful external login -
201 external principal attached successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public AuthenticationToken execute() throws ApiException { - ApiResponse localVarResp = externalPrincipalLoginWithHttpInfo(externalLoginInformation); - return localVarResp.getData(); + public void execute() throws ApiException { + createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); } /** - * Execute externalPrincipalLogin request with HTTP info returned - * @return ApiResponse<AuthenticationToken> + * 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
200 successful external login -
201 external principal attached successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return externalPrincipalLoginWithHttpInfo(externalLoginInformation); + public ApiResponse executeWithHttpInfo() throws ApiException { + return createUserExternalPrincipalWithHttpInfo(userId, principalId, externalPrincipalCreation); } /** - * Execute externalPrincipalLogin 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
200 successful external login -
201 external principal attached successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
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 createUserExternalPrincipalAsync(userId, principalId, externalPrincipalCreation, _callback); } } /** - * perform a login using an external authenticator + * attach external principal to user * - * @return APIexternalPrincipalLoginRequest + * @param userId (required) + * @param principalId (required) + * @return APIcreateUserExternalPrincipalRequest * @http.response.details - + - +
Status Code Description Response Headers
200 successful external login -
201 external principal attached successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
429 too many requests -
0 Internal Server Error -
*/ - public APIexternalPrincipalLoginRequest externalPrincipalLogin() { - return new APIexternalPrincipalLoginRequest(); + public APIcreateUserExternalPrincipalRequest createUserExternalPrincipal(String userId, String principalId) { + return new APIcreateUserExternalPrincipalRequest(userId, principalId); } - 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[] { }; @@ -1531,7 +1601,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(); @@ -1559,51 +1630,56 @@ 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); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = deleteUserExternalPrincipalValidateBeforeCall(userId, principalId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - public class APIgetExternalPrincipalRequest { + public class APIdeleteUserExternalPrincipalRequest { + private final String userId; private final String principalId; - private APIgetExternalPrincipalRequest(String principalId) { + private APIdeleteUserExternalPrincipalRequest(String userId, String principalId) { + this.userId = userId; this.principalId = principalId; } /** - * Build call for getExternalPrincipal + * 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 - + @@ -1612,17 +1688,16 @@ private APIgetExternalPrincipalRequest(String principalId) {
Status Code Description Response Headers
200 external principal -
204 external principal detached successfully -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getExternalPrincipalCall(principalId, _callback); + return deleteUserExternalPrincipalCall(userId, principalId, _callback); } /** - * Execute getExternalPrincipal request - * @return ExternalPrincipal + * Execute deleteUserExternalPrincipal request * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + @@ -1630,19 +1705,18 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
Status Code Description Response Headers
200 external principal -
204 external principal detached successfully -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
*/ - public ExternalPrincipal execute() throws ApiException { - ApiResponse localVarResp = getExternalPrincipalWithHttpInfo(principalId); - return localVarResp.getData(); + public void execute() throws ApiException { + deleteUserExternalPrincipalWithHttpInfo(userId, principalId); } /** - * Execute getExternalPrincipal request with HTTP info returned - * @return ApiResponse<ExternalPrincipal> + * 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 - + @@ -1650,19 +1724,19 @@ public ExternalPrincipal execute() throws ApiException {
Status Code Description Response Headers
200 external principal -
204 external principal detached successfully -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getExternalPrincipalWithHttpInfo(principalId); + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteUserExternalPrincipalWithHttpInfo(userId, principalId); } /** - * Execute getExternalPrincipal request (asynchronously) + * 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 - + @@ -1670,20 +1744,21 @@ public ApiResponse executeWithHttpInfo() throws ApiException
Status Code Description Response Headers
200 external principal -
204 external principal detached successfully -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
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 deleteUserExternalPrincipalAsync(userId, principalId, _callback); } } /** - * describe external principal by id + * delete external principal from user * + * @param userId (required) * @param principalId (required) - * @return APIgetExternalPrincipalRequest + * @return APIdeleteUserExternalPrincipalRequest * @http.response.details - + @@ -1691,10 +1766,10 @@ public okhttp3.Call executeAsync(final ApiCallback _callback)
Status Code Description Response Headers
200 external principal -
204 external principal detached successfully -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
*/ - public APIgetExternalPrincipalRequest getExternalPrincipal(String principalId) { - return new APIgetExternalPrincipalRequest(principalId); + public APIdeleteUserExternalPrincipalRequest deleteUserExternalPrincipal(String userId, String principalId) { + return new APIdeleteUserExternalPrincipalRequest(userId, principalId); } - private okhttp3.Call getLicenseCall(final ApiCallback _callback) throws ApiException { + private okhttp3.Call externalPrincipalLoginCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1708,10 +1783,10 @@ private okhttp3.Call getLicenseCall(final ApiCallback _callback) throws ApiExcep basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = externalLoginInformation; // create path and map variables - String localVarPath = "/license"; + String localVarPath = "/auth/external/principal/login"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1728,131 +1803,158 @@ private okhttp3.Call getLicenseCall(final ApiCallback _callback) throws ApiExcep } 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getLicenseValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getLicenseCall(_callback); + private okhttp3.Call externalPrincipalLoginValidateBeforeCall(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { + return externalPrincipalLoginCall(externalLoginInformation, _callback); } - private ApiResponse getLicenseWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getLicenseValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 getLicenseAsync(final ApiCallback _callback) throws ApiException { + private okhttp3.Call externalPrincipalLoginAsync(ExternalLoginInformation externalLoginInformation, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getLicenseValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = externalPrincipalLoginValidateBeforeCall(externalLoginInformation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetLicenseRequest { + public class APIexternalPrincipalLoginRequest { + private ExternalLoginInformation externalLoginInformation; - private APIgetLicenseRequest() { + private APIexternalPrincipalLoginRequest() { } /** - * Build call for getLicense + * 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 lakeFS configuration -
200 successful external login -
400 Bad Request -
401 Unauthorized -
501 Not Implemented -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getLicenseCall(_callback); + return externalPrincipalLoginCall(externalLoginInformation, _callback); } /** - * Execute getLicense request - * @return License + * 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 lakeFS configuration -
200 successful external login -
400 Bad Request -
401 Unauthorized -
501 Not Implemented -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public License execute() throws ApiException { - ApiResponse localVarResp = getLicenseWithHttpInfo(); + public AuthenticationToken execute() throws ApiException { + ApiResponse localVarResp = externalPrincipalLoginWithHttpInfo(externalLoginInformation); return localVarResp.getData(); } /** - * Execute getLicense request with HTTP info returned - * @return ApiResponse<License> + * 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 lakeFS configuration -
200 successful external login -
400 Bad Request -
401 Unauthorized -
501 Not Implemented -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getLicenseWithHttpInfo(); + public ApiResponse executeWithHttpInfo() throws ApiException { + return externalPrincipalLoginWithHttpInfo(externalLoginInformation); } /** - * Execute getLicense request (asynchronously) + * 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 lakeFS configuration -
200 successful external login -
400 Bad Request -
401 Unauthorized -
501 Not Implemented -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getLicenseAsync(_callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return externalPrincipalLoginAsync(externalLoginInformation, _callback); } } /** + * perform a login using an external authenticator * - * retrieve lakeFS license information - * @return APIgetLicenseRequest + * @return APIexternalPrincipalLoginRequest * @http.response.details - + + - + + +
Status Code Description Response Headers
200 lakeFS configuration -
200 successful external login -
400 Bad Request -
401 Unauthorized -
501 Not Implemented -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public APIgetLicenseRequest getLicense() { - return new APIgetLicenseRequest(); + public APIexternalPrincipalLoginRequest externalPrincipalLogin() { + return new APIexternalPrincipalLoginRequest(); } - private okhttp3.Call getPullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getExternalPrincipalCall(String principalId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1869,9 +1971,7 @@ private okhttp3.Call getPullRequestCall(String repository, String pullRequest, f 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())); + String localVarPath = "/auth/external/principals"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1879,6 +1979,10 @@ private okhttp3.Call getPullRequestCall(String repository, String pullRequest, f Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (principalId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("principalId", principalId)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1899,55 +2003,48 @@ private okhttp3.Call getPullRequestCall(String repository, String pullRequest, f } @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)"); + 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 getPullRequestCall(repository, pullRequest, _callback); + return getExternalPrincipalCall(principalId, _callback); } - private ApiResponse getPullRequestWithHttpInfo(String repository, String pullRequest) throws ApiException { - okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getExternalPrincipalAsync(String principalId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getExternalPrincipalValidateBeforeCall(principalId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetPullRequestRequest { - private final String repository; - private final String pullRequest; + public class APIgetExternalPrincipalRequest { + private final String principalId; - private APIgetPullRequestRequest(String repository, String pullRequest) { - this.repository = repository; - this.pullRequest = pullRequest; + private APIgetExternalPrincipalRequest(String principalId) { + this.principalId = principalId; } /** - * Build call for getPullRequest + * 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 - - + + @@ -1955,90 +2052,89 @@ private APIgetPullRequestRequest(String repository, String pullRequest) {
Status Code Description Response Headers
200 pull request -
400 Validation Error -
200 external principal -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getPullRequestCall(repository, pullRequest, _callback); + return getExternalPrincipalCall(principalId, _callback); } /** - * Execute getPullRequest request - * @return PullRequest + * 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 pull request -
400 Validation Error -
200 external principal -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public PullRequest execute() throws ApiException { - ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); + public ExternalPrincipal execute() throws ApiException { + ApiResponse localVarResp = getExternalPrincipalWithHttpInfo(principalId); return localVarResp.getData(); } /** - * Execute getPullRequest request with HTTP info returned - * @return ApiResponse<PullRequest> + * 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 pull request -
400 Validation Error -
200 external principal -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getPullRequestWithHttpInfo(repository, pullRequest); + public ApiResponse executeWithHttpInfo() throws ApiException { + return getExternalPrincipalWithHttpInfo(principalId); } /** - * Execute getPullRequest request (asynchronously) + * 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 pull request -
400 Validation Error -
200 external principal -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getPullRequestAsync(repository, pullRequest, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getExternalPrincipalAsync(principalId, _callback); } } /** - * get pull request + * describe external principal by id * - * @param repository (required) - * @param pullRequest pull request id (required) - * @return APIgetPullRequestRequest + * @param principalId (required) + * @return APIgetExternalPrincipalRequest * @http.response.details - - + +
Status Code Description Response Headers
200 pull request -
400 Validation Error -
200 external principal -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public APIgetPullRequestRequest getPullRequest(String repository, String pullRequest) { - return new APIgetPullRequestRequest(repository, pullRequest); + public APIgetExternalPrincipalRequest getExternalPrincipal(String principalId) { + return new APIgetExternalPrincipalRequest(principalId); } - private okhttp3.Call getTokenFromMailboxCall(String mailbox, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getLicenseCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2055,8 +2151,7 @@ private okhttp3.Call getTokenFromMailboxCall(String mailbox, final ApiCallback _ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/get-token/mailboxes/{mailbox}" - .replace("{" + "mailbox" + "}", localVarApiClient.escapeString(mailbox.toString())); + String localVarPath = "/license"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2079,148 +2174,125 @@ private okhttp3.Call getTokenFromMailboxCall(String mailbox, final ApiCallback _ localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { }; + 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 getTokenFromMailboxValidateBeforeCall(String mailbox, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'mailbox' is set - if (mailbox == null) { - throw new ApiException("Missing the required parameter 'mailbox' when calling getTokenFromMailbox(Async)"); - } - - return getTokenFromMailboxCall(mailbox, _callback); + private okhttp3.Call getLicenseValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getLicenseCall(_callback); } - private ApiResponse getTokenFromMailboxWithHttpInfo(String mailbox) throws ApiException { - okhttp3.Call localVarCall = getTokenFromMailboxValidateBeforeCall(mailbox, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse getLicenseWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getLicenseValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call getTokenFromMailboxAsync(String mailbox, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getLicenseAsync(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTokenFromMailboxValidateBeforeCall(mailbox, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getLicenseValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetTokenFromMailboxRequest { - private final String mailbox; + public class APIgetLicenseRequest { - private APIgetTokenFromMailboxRequest(String mailbox) { - this.mailbox = mailbox; + private APIgetLicenseRequest() { } /** - * Build call for getTokenFromMailbox + * Build call for getLicense * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - + - -
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
200 lakeFS configuration -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getTokenFromMailboxCall(mailbox, _callback); + return getLicenseCall(_callback); } /** - * Execute getTokenFromMailbox request - * @return AuthenticationToken + * Execute getLicense request + * @return License * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + - -
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
200 lakeFS configuration -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public AuthenticationToken execute() throws ApiException { - ApiResponse localVarResp = getTokenFromMailboxWithHttpInfo(mailbox); + public License execute() throws ApiException { + ApiResponse localVarResp = getLicenseWithHttpInfo(); return localVarResp.getData(); } /** - * Execute getTokenFromMailbox request with HTTP info returned - * @return ApiResponse<AuthenticationToken> + * Execute getLicense request with HTTP info returned + * @return ApiResponse<License> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + - -
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
200 lakeFS configuration -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getTokenFromMailboxWithHttpInfo(mailbox); + public ApiResponse executeWithHttpInfo() throws ApiException { + return getLicenseWithHttpInfo(); } /** - * Execute getTokenFromMailbox request (asynchronously) + * Execute getLicense request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - - + - -
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
200 lakeFS configuration -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getTokenFromMailboxAsync(mailbox, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getLicenseAsync(_callback); } } /** - * receive the token after user has authenticated on redirect URL. * - * @param mailbox mailbox returned by getTokenRedirect (required) - * @return APIgetTokenFromMailboxRequest + * retrieve lakeFS license information + * @return APIgetLicenseRequest * @http.response.details - - + - -
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
200 lakeFS configuration -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIgetTokenFromMailboxRequest getTokenFromMailbox(String mailbox) { - return new APIgetTokenFromMailboxRequest(mailbox); + public APIgetLicenseRequest getLicense() { + return new APIgetLicenseRequest(); } - private okhttp3.Call getTokenRedirectCall(final ApiCallback _callback) throws ApiException { + private okhttp3.Call getPullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2237,7 +2309,9 @@ private okhttp3.Call getTokenRedirectCall(final ApiCallback _callback) throws Ap Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/get-token/start"; + 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(); @@ -2260,130 +2334,151 @@ private okhttp3.Call getTokenRedirectCall(final ApiCallback _callback) throws Ap localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { }; + 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 getTokenRedirectValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getTokenRedirectCall(_callback); + 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 getTokenRedirectWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getTokenRedirectValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 getTokenRedirectAsync(final ApiCallback _callback) throws ApiException { + private okhttp3.Call getPullRequestAsync(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTokenRedirectValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getPullRequestValidateBeforeCall(repository, pullRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetTokenRedirectRequest { + public class APIgetPullRequestRequest { + private final String repository; + private final String pullRequest; - private APIgetTokenRedirectRequest() { + private APIgetPullRequestRequest(String repository, String pullRequest) { + this.repository = repository; + this.pullRequest = pullRequest; } /** - * Build call for getTokenRedirect + * 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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
200 pull request -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getTokenRedirectCall(_callback); + return getPullRequestCall(repository, pullRequest, _callback); } /** - * Execute getTokenRedirect request - * @return Error + * 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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
200 pull request -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public Error execute() throws ApiException { - ApiResponse localVarResp = getTokenRedirectWithHttpInfo(); + public PullRequest execute() throws ApiException { + ApiResponse localVarResp = getPullRequestWithHttpInfo(repository, pullRequest); return localVarResp.getData(); } /** - * Execute getTokenRedirect request with HTTP info returned - * @return ApiResponse<Error> + * 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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
200 pull request -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getTokenRedirectWithHttpInfo(); + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPullRequestWithHttpInfo(repository, pullRequest); } /** - * Execute getTokenRedirect 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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
200 pull request -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getTokenRedirectAsync(_callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPullRequestAsync(repository, pullRequest, _callback); } } /** - * start acquiring a token by logging in on a browser + * get pull request * - * @return APIgetTokenRedirectRequest + * @param repository (required) + * @param pullRequest pull request id (required) + * @return APIgetPullRequestRequest * @http.response.details - + + + -
Status Code Description Response Headers
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
200 pull request -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIgetTokenRedirectRequest getTokenRedirect() { - return new APIgetTokenRedirectRequest(); + 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 { + private okhttp3.Call getTokenFromMailboxCall(String mailbox, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2400,9 +2495,8 @@ private okhttp3.Call hardResetBranchCall(String repository, String branch, Strin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/repositories/{repository}/branches/{branch}/hard_reset" - .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) - .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + String localVarPath = "/auth/get-token/mailboxes/{mailbox}" + .replace("{" + "mailbox" + "}", localVarApiClient.escapeString(mailbox.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2410,14 +2504,6 @@ 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 (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - final String[] localVarAccepts = { "application/json" }; @@ -2433,171 +2519,984 @@ private okhttp3.Call hardResetBranchCall(String repository, String branch, Strin 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); + String[] localVarAuthNames = new String[] { }; + 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 { - // 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)"); + private okhttp3.Call getTokenFromMailboxValidateBeforeCall(String mailbox, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mailbox' is set + if (mailbox == null) { + throw new ApiException("Missing the required parameter 'mailbox' when calling getTokenFromMailbox(Async)"); } - return hardResetBranchCall(repository, branch, ref, force, _callback); + return getTokenFromMailboxCall(mailbox, _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 getTokenFromMailboxWithHttpInfo(String mailbox) throws ApiException { + okhttp3.Call localVarCall = getTokenFromMailboxValidateBeforeCall(mailbox, 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 getTokenFromMailboxAsync(String mailbox, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = hardResetBranchValidateBeforeCall(repository, branch, ref, force, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = getTokenFromMailboxValidateBeforeCall(mailbox, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIhardResetBranchRequest { - private final String repository; - private final String branch; - private final String ref; - private Boolean force; + public class APIgetTokenFromMailboxRequest { + private final String mailbox; - private APIhardResetBranchRequest(String repository, String branch, String ref) { - this.repository = repository; - this.branch = branch; + private APIgetTokenFromMailboxRequest(String mailbox) { + this.mailbox = mailbox; + } + + /** + * Build call for getTokenFromMailbox + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTokenFromMailboxCall(mailbox, _callback); + } + + /** + * Execute getTokenFromMailbox 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 user successfully logged in -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public AuthenticationToken execute() throws ApiException { + ApiResponse localVarResp = getTokenFromMailboxWithHttpInfo(mailbox); + return localVarResp.getData(); + } + + /** + * Execute getTokenFromMailbox 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 user successfully logged in -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTokenFromMailboxWithHttpInfo(mailbox); + } + + /** + * Execute getTokenFromMailbox request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTokenFromMailboxAsync(mailbox, _callback); + } + } + + /** + * receive the token after user has authenticated on redirect URL. + * + * @param mailbox mailbox returned by getTokenRedirect (required) + * @return APIgetTokenFromMailboxRequest + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 user successfully logged in -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public APIgetTokenFromMailboxRequest getTokenFromMailbox(String mailbox) { + return new APIgetTokenFromMailboxRequest(mailbox); + } + private okhttp3.Call getTokenRedirectCall(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/get-token/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTokenRedirectValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getTokenRedirectCall(_callback); + + } + + + private ApiResponse getTokenRedirectWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getTokenRedirectValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getTokenRedirectAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTokenRedirectValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTokenRedirectRequest { + + private APIgetTokenRedirectRequest() { + } + + /** + * Build call for getTokenRedirect + * @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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
401 Unauthorized -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTokenRedirectCall(_callback); + } + + /** + * Execute getTokenRedirect request + * @return Error + * @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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
401 Unauthorized -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public Error execute() throws ApiException { + ApiResponse localVarResp = getTokenRedirectWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Execute getTokenRedirect request with HTTP info returned + * @return ApiResponse<Error> + * @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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
401 Unauthorized -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTokenRedirectWithHttpInfo(); + } + + /** + * Execute getTokenRedirect 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
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
401 Unauthorized -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTokenRedirectAsync(_callback); + } + } + + /** + * start acquiring a token by logging in on a browser + * + * @return APIgetTokenRedirectRequest + * @http.response.details + + + + + + + +
Status Code Description Response Headers
303 login on this page, await results on the mailbox URL * Location - redirect to S3
* X-LakeFS-Mailbox - GET the token from this mailbox. Keep the mailbox SECRET!
401 Unauthorized -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
+ */ + public APIgetTokenRedirectRequest getTokenRedirect() { + return new APIgetTokenRedirectRequest(); + } + private okhttp3.Call hardResetBranchCall(String repository, String branch, String ref, Boolean force, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/hard_reset" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (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 + * 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 -
429 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 -
429 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 -
429 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 -
429 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 -
429 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 status, 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 (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + 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 status, 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, status, _callback); + + } + + + private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _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 status; + + 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 status + * @param status (optional, default to all) + * @return APIlistPullRequestsRequest + */ + public APIlistPullRequestsRequest status(String status) { + this.status = status; + 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 -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listPullRequestsCall(repository, prefix, after, amount, status, _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 -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public APIhardResetBranchRequest force(Boolean force) { - this.force = force; + public PullRequestsList execute() throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); + 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 -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); + } + + /** + * 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 -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listPullRequestsAsync(repository, prefix, after, amount, status, _callback); + } + } + + /** + * list pull requests + * + * @param repository (required) + * @return APIlistPullRequestsRequest + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 list of pull requests -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
+ */ + 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; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/auth/users/{userId}/external/principals/ls" + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (after != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUserExternalPrincipalsValidateBeforeCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling listUserExternalPrincipals(Async)"); + } + + return listUserExternalPrincipalsCall(userId, prefix, after, amount, _callback); + + } + + + private ApiResponse listUserExternalPrincipalsWithHttpInfo(String userId, String prefix, String after, Integer amount) throws ApiException { + okhttp3.Call localVarCall = listUserExternalPrincipalsValidateBeforeCall(userId, prefix, after, amount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUserExternalPrincipalsAsync(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listUserExternalPrincipalsValidateBeforeCall(userId, prefix, after, amount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUserExternalPrincipalsRequest { + private final String userId; + private String prefix; + private String after; + private Integer amount; + + private APIlistUserExternalPrincipalsRequest(String userId) { + this.userId = userId; + } + + /** + * Set prefix + * @param prefix return items prefixed with this value (optional) + * @return APIlistUserExternalPrincipalsRequest + */ + public APIlistUserExternalPrincipalsRequest prefix(String prefix) { + this.prefix = prefix; return this; } /** - * Build call for hardResetBranch + * Set after + * @param after return items after this value (optional) + * @return APIlistUserExternalPrincipalsRequest + */ + public APIlistUserExternalPrincipalsRequest after(String after) { + this.after = after; + return this; + } + + /** + * Set amount + * @param amount how many items to return (optional, default to 100) + * @return APIlistUserExternalPrincipalsRequest + */ + public APIlistUserExternalPrincipalsRequest amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Build call for listUserExternalPrincipals * @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 -
200 external principals list -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return hardResetBranchCall(repository, branch, ref, force, _callback); + return listUserExternalPrincipalsCall(userId, prefix, after, amount, _callback); } /** - * Execute hardResetBranch request + * Execute listUserExternalPrincipals request + * @return ExternalPrincipalList * @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 -
200 external principals list -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public void execute() throws ApiException { - hardResetBranchWithHttpInfo(repository, branch, ref, force); + public ExternalPrincipalList execute() throws ApiException { + ApiResponse localVarResp = listUserExternalPrincipalsWithHttpInfo(userId, prefix, after, amount); + return localVarResp.getData(); } /** - * Execute hardResetBranch request with HTTP info returned - * @return ApiResponse<Void> + * Execute listUserExternalPrincipals request with HTTP info returned + * @return ApiResponse<ExternalPrincipalList> * @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 -
200 external principals list -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return hardResetBranchWithHttpInfo(repository, branch, ref, force); + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUserExternalPrincipalsWithHttpInfo(userId, prefix, after, amount); } /** - * Execute hardResetBranch request (asynchronously) + * Execute listUserExternalPrincipals 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 -
200 external principals list -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 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 listUserExternalPrincipalsAsync(userId, prefix, after, amount, _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 + + /** + * list user external policies attached to a user + * + * @param userId (required) + * @return APIlistUserExternalPrincipalsRequest * @http.response.details - + -
Status Code Description Response Headers
204 reset successful -
200 external principals list -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -
*/ - public APIhardResetBranchRequest hardResetBranch(String repository, String branch, String ref) { - return new APIhardResetBranchRequest(repository, branch, ref); + public APIlistUserExternalPrincipalsRequest listUserExternalPrincipals(String userId) { + return new APIlistUserExternalPrincipalsRequest(userId); } - private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { + private okhttp3.Call mergeIntoBranchAsyncCall(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2611,11 +3510,13 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = merge; // create path and map variables - String localVarPath = "/repositories/{repository}/pulls" - .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())); + String localVarPath = "/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "sourceRef" + "}", localVarApiClient.escapeString(sourceRef.toString())) + .replace("{" + "destinationBranch" + "}", localVarApiClient.escapeString(destinationBranch.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2623,22 +3524,6 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri 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 (status != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); - } - final String[] localVarAccepts = { "application/json" }; @@ -2648,6 +3533,7 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2655,186 +3541,179 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri } 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { + private okhttp3.Call mergeIntoBranchAsyncValidateBeforeCall(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { - throw new ApiException("Missing the required parameter 'repository' when calling listPullRequests(Async)"); + throw new ApiException("Missing the required parameter 'repository' when calling mergeIntoBranchAsync(Async)"); } - return listPullRequestsCall(repository, prefix, after, amount, status, _callback); + // verify the required parameter 'sourceRef' is set + if (sourceRef == null) { + throw new ApiException("Missing the required parameter 'sourceRef' when calling mergeIntoBranchAsync(Async)"); + } + + // verify the required parameter 'destinationBranch' is set + if (destinationBranch == null) { + throw new ApiException("Missing the required parameter 'destinationBranch' when calling mergeIntoBranchAsync(Async)"); + } + + return mergeIntoBranchAsyncCall(repository, sourceRef, destinationBranch, merge, _callback); } - private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse mergeIntoBranchAsyncWithHttpInfo(String repository, String sourceRef, String destinationBranch, Merge merge) throws ApiException { + okhttp3.Call localVarCall = mergeIntoBranchAsyncValidateBeforeCall(repository, sourceRef, destinationBranch, merge, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { + private okhttp3.Call mergeIntoBranchAsyncAsync(String repository, String sourceRef, String destinationBranch, Merge merge, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = mergeIntoBranchAsyncValidateBeforeCall(repository, sourceRef, destinationBranch, merge, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistPullRequestsRequest { + public class APImergeIntoBranchAsyncRequest { private final String repository; - private String prefix; - private String after; - private Integer amount; - private String status; + private final String sourceRef; + private final String destinationBranch; + private Merge merge; - private APIlistPullRequestsRequest(String repository) { + private APImergeIntoBranchAsyncRequest(String repository, String sourceRef, String destinationBranch) { this.repository = repository; + this.sourceRef = sourceRef; + this.destinationBranch = destinationBranch; } /** - * 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 status - * @param status (optional, default to all) - * @return APIlistPullRequestsRequest + * Set merge + * @param merge (optional) + * @return APImergeIntoBranchAsyncRequest */ - public APIlistPullRequestsRequest status(String status) { - this.status = status; + public APImergeIntoBranchAsyncRequest merge(Merge merge) { + this.merge = merge; return this; } /** - * Build call for listPullRequests + * Build call for mergeIntoBranchAsync * @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 -
400 Bad Request -
202 merge task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPullRequestsCall(repository, prefix, after, amount, status, _callback); + return mergeIntoBranchAsyncCall(repository, sourceRef, destinationBranch, merge, _callback); } /** - * Execute listPullRequests request - * @return PullRequestsList + * Execute mergeIntoBranchAsync request + * @return TaskCreation * @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 -
400 Bad Request -
202 merge task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public PullRequestsList execute() throws ApiException { - ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); + public TaskCreation execute() throws ApiException { + ApiResponse localVarResp = mergeIntoBranchAsyncWithHttpInfo(repository, sourceRef, destinationBranch, merge); return localVarResp.getData(); } /** - * Execute listPullRequests request with HTTP info returned - * @return ApiResponse<PullRequestsList> + * Execute mergeIntoBranchAsync request with HTTP info returned + * @return ApiResponse<TaskCreation> * @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 -
400 Bad Request -
202 merge task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); + public ApiResponse executeWithHttpInfo() throws ApiException { + return mergeIntoBranchAsyncWithHttpInfo(repository, sourceRef, destinationBranch, merge); } /** - * Execute listPullRequests request (asynchronously) + * Execute mergeIntoBranchAsync 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 -
400 Bad Request -
202 merge task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return listPullRequestsAsync(repository, prefix, after, amount, status, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return mergeIntoBranchAsyncAsync(repository, sourceRef, destinationBranch, merge, _callback); } } /** - * list pull requests + * merge references asynchronously * * @param repository (required) - * @return APIlistPullRequestsRequest + * @param sourceRef source ref (required) + * @param destinationBranch destination branch name (required) + * @return APImergeIntoBranchAsyncRequest * @http.response.details - - + + + +
Status Code Description Response Headers
200 list of pull requests -
400 Bad Request -
202 merge task started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIlistPullRequestsRequest listPullRequests(String repository) { - return new APIlistPullRequestsRequest(repository); + public APImergeIntoBranchAsyncRequest mergeIntoBranchAsync(String repository, String sourceRef, String destinationBranch) { + return new APImergeIntoBranchAsyncRequest(repository, sourceRef, destinationBranch); } - private okhttp3.Call listUserExternalPrincipalsCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + private okhttp3.Call mergeIntoBranchAsyncStatusCall(String repository, String sourceRef, String destinationBranch, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2851,8 +3730,11 @@ private okhttp3.Call listUserExternalPrincipalsCall(String userId, String prefix Object localVarPostBody = null; // create path and map variables - String localVarPath = "/auth/users/{userId}/external/principals/ls" - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = "/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status" + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "sourceRef" + "}", localVarApiClient.escapeString(sourceRef.toString())) + .replace("{" + "destinationBranch" + "}", localVarApiClient.escapeString(destinationBranch.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2860,18 +3742,6 @@ private okhttp3.Call listUserExternalPrincipalsCall(String userId, String prefix Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (prefix != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); - } - - if (after != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after)); - } - - if (amount != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); - } - final String[] localVarAccepts = { "application/json" }; @@ -2892,169 +3762,180 @@ private okhttp3.Call listUserExternalPrincipalsCall(String userId, String prefix } @SuppressWarnings("rawtypes") - private okhttp3.Call listUserExternalPrincipalsValidateBeforeCall(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling listUserExternalPrincipals(Async)"); + private okhttp3.Call mergeIntoBranchAsyncStatusValidateBeforeCall(String repository, String sourceRef, String destinationBranch, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling mergeIntoBranchAsyncStatus(Async)"); } - return listUserExternalPrincipalsCall(userId, prefix, after, amount, _callback); + // verify the required parameter 'sourceRef' is set + if (sourceRef == null) { + throw new ApiException("Missing the required parameter 'sourceRef' when calling mergeIntoBranchAsyncStatus(Async)"); + } + + // verify the required parameter 'destinationBranch' is set + if (destinationBranch == null) { + throw new ApiException("Missing the required parameter 'destinationBranch' when calling mergeIntoBranchAsyncStatus(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling mergeIntoBranchAsyncStatus(Async)"); + } + + return mergeIntoBranchAsyncStatusCall(repository, sourceRef, destinationBranch, id, _callback); } - private ApiResponse listUserExternalPrincipalsWithHttpInfo(String userId, String prefix, String after, Integer amount) throws ApiException { - okhttp3.Call localVarCall = listUserExternalPrincipalsValidateBeforeCall(userId, prefix, after, amount, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse mergeIntoBranchAsyncStatusWithHttpInfo(String repository, String sourceRef, String destinationBranch, String id) throws ApiException { + okhttp3.Call localVarCall = mergeIntoBranchAsyncStatusValidateBeforeCall(repository, sourceRef, destinationBranch, id, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listUserExternalPrincipalsAsync(String userId, String prefix, String after, Integer amount, final ApiCallback _callback) throws ApiException { + private okhttp3.Call mergeIntoBranchAsyncStatusAsync(String repository, String sourceRef, String destinationBranch, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listUserExternalPrincipalsValidateBeforeCall(userId, prefix, after, amount, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = mergeIntoBranchAsyncStatusValidateBeforeCall(repository, sourceRef, destinationBranch, id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistUserExternalPrincipalsRequest { - private final String userId; - private String prefix; - private String after; - private Integer amount; - - private APIlistUserExternalPrincipalsRequest(String userId) { - this.userId = userId; - } - - /** - * Set prefix - * @param prefix return items prefixed with this value (optional) - * @return APIlistUserExternalPrincipalsRequest - */ - public APIlistUserExternalPrincipalsRequest prefix(String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Set after - * @param after return items after this value (optional) - * @return APIlistUserExternalPrincipalsRequest - */ - public APIlistUserExternalPrincipalsRequest after(String after) { - this.after = after; - return this; - } + public class APImergeIntoBranchAsyncStatusRequest { + private final String repository; + private final String sourceRef; + private final String destinationBranch; + private final String id; - /** - * Set amount - * @param amount how many items to return (optional, default to 100) - * @return APIlistUserExternalPrincipalsRequest - */ - public APIlistUserExternalPrincipalsRequest amount(Integer amount) { - this.amount = amount; - return this; + private APImergeIntoBranchAsyncStatusRequest(String repository, String sourceRef, String destinationBranch, String id) { + this.repository = repository; + this.sourceRef = sourceRef; + this.destinationBranch = destinationBranch; + this.id = id; } /** - * Build call for listUserExternalPrincipals + * Build call for mergeIntoBranchAsyncStatus * @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 principals list -
400 Bad Request -
200 merge task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listUserExternalPrincipalsCall(userId, prefix, after, amount, _callback); + return mergeIntoBranchAsyncStatusCall(repository, sourceRef, destinationBranch, id, _callback); } /** - * Execute listUserExternalPrincipals request - * @return ExternalPrincipalList + * Execute mergeIntoBranchAsyncStatus request + * @return MergeAsyncStatus * @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 principals list -
400 Bad Request -
200 merge task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ExternalPrincipalList execute() throws ApiException { - ApiResponse localVarResp = listUserExternalPrincipalsWithHttpInfo(userId, prefix, after, amount); + public MergeAsyncStatus execute() throws ApiException { + ApiResponse localVarResp = mergeIntoBranchAsyncStatusWithHttpInfo(repository, sourceRef, destinationBranch, id); return localVarResp.getData(); } /** - * Execute listUserExternalPrincipals request with HTTP info returned - * @return ApiResponse<ExternalPrincipalList> + * Execute mergeIntoBranchAsyncStatus request with HTTP info returned + * @return ApiResponse<MergeAsyncStatus> * @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 principals list -
400 Bad Request -
200 merge task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return listUserExternalPrincipalsWithHttpInfo(userId, prefix, after, amount); + public ApiResponse executeWithHttpInfo() throws ApiException { + return mergeIntoBranchAsyncStatusWithHttpInfo(repository, sourceRef, destinationBranch, id); } /** - * Execute listUserExternalPrincipals request (asynchronously) + * Execute mergeIntoBranchAsyncStatus 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 principals list -
400 Bad Request -
200 merge task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return listUserExternalPrincipalsAsync(userId, prefix, after, amount, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return mergeIntoBranchAsyncStatusAsync(repository, sourceRef, destinationBranch, id, _callback); } } /** - * list user external policies attached to a user + * get status of async merge operation * - * @param userId (required) - * @return APIlistUserExternalPrincipalsRequest + * @param repository (required) + * @param sourceRef source ref (required) + * @param destinationBranch destination branch name (required) + * @param id Unique identifier of the merge async task (required) + * @return APImergeIntoBranchAsyncStatusRequest * @http.response.details - - + + + + + +
Status Code Description Response Headers
200 external principals list -
400 Bad Request -
200 merge task status -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -
*/ - public APIlistUserExternalPrincipalsRequest listUserExternalPrincipals(String userId) { - return new APIlistUserExternalPrincipalsRequest(userId); + public APImergeIntoBranchAsyncStatusRequest mergeIntoBranchAsyncStatus(String repository, String sourceRef, String destinationBranch, String id) { + return new APImergeIntoBranchAsyncStatusRequest(repository, sourceRef, destinationBranch, id); } private okhttp3.Call mergePullRequestCall(String repository, String pullRequest, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -3156,7 +4037,7 @@ private APImergePullRequestRequest(String repository, String pullRequest) { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -3178,7 +4059,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -3201,7 +4082,7 @@ public MergeResult execute() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -3224,7 +4105,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -3249,7 +4130,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throw 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - 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 80f3d4468cb..18d88277276 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 @@ -98,6 +98,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AccessKeyCredentials.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ActionRun.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.ActionRunList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AsyncTaskStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AuthCapabilities.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.AuthenticationToken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.BranchCreation.CustomTypeAdapterFactory()); @@ -105,6 +106,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CherryPickCreation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommPrefsInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Commit.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitAsyncStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitCreation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.CommitOverrides.CustomTypeAdapterFactory()); @@ -150,6 +152,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.LoginConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.LoginInformation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.Merge.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MergeAsyncStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MergeResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MetaRangeCreation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.sdk.model.MetaRangeCreationResponse.CustomTypeAdapterFactory()); 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 index a864d6e5783..8f445cc9234 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java @@ -797,7 +797,7 @@ private APImergePullRequestRequest(String repository, String pullRequest) { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -819,7 +819,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -842,7 +842,7 @@ public MergeResult execute() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -865,7 +865,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - @@ -890,7 +890,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throw 403 Forbidden - 404 Resource Not Found - 409 Conflict Deprecated: content schema will return Error format and not an empty MergeResult - - 412 precondition failed (e.g. a pre-merge hook returned a failure) - + 412 precondition failed - 429 too many requests - 0 Internal Server Error - diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AsyncTaskStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AsyncTaskStatus.java new file mode 100644 index 00000000000..99ee57b547f --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AsyncTaskStatus.java @@ -0,0 +1,412 @@ +/* + * 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.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * AsyncTaskStatus + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AsyncTaskStatus { + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + private String taskId; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Boolean completed; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private OffsetDateTime updateTime; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private Error error; + + public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public AsyncTaskStatus() { + } + + public AsyncTaskStatus taskId(String taskId) { + + this.taskId = taskId; + return this; + } + + /** + * the id of the async task + * @return taskId + **/ + @javax.annotation.Nonnull + public String getTaskId() { + return taskId; + } + + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + + public AsyncTaskStatus completed(Boolean completed) { + + this.completed = completed; + return this; + } + + /** + * true if the task has completed (either successfully or with an error) + * @return completed + **/ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + + public AsyncTaskStatus updateTime(OffsetDateTime updateTime) { + + this.updateTime = updateTime; + return this; + } + + /** + * last time the task status was updated + * @return updateTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(OffsetDateTime updateTime) { + this.updateTime = updateTime; + } + + + public AsyncTaskStatus error(Error error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public Error getError() { + return error; + } + + + public void setError(Error error) { + this.error = error; + } + + + public AsyncTaskStatus statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * an http status code that correlates with the underlying error if exists + * @return statusCode + **/ + @javax.annotation.Nullable + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + /** + * 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 AsyncTaskStatus instance itself + */ + public AsyncTaskStatus 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; + } + AsyncTaskStatus asyncTaskStatus = (AsyncTaskStatus) o; + return Objects.equals(this.taskId, asyncTaskStatus.taskId) && + Objects.equals(this.completed, asyncTaskStatus.completed) && + Objects.equals(this.updateTime, asyncTaskStatus.updateTime) && + Objects.equals(this.error, asyncTaskStatus.error) && + Objects.equals(this.statusCode, asyncTaskStatus.statusCode)&& + Objects.equals(this.additionalProperties, asyncTaskStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(taskId, completed, updateTime, error, statusCode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AsyncTaskStatus {\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).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("task_id"); + openapiFields.add("completed"); + openapiFields.add("update_time"); + openapiFields.add("error"); + openapiFields.add("status_code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("task_id"); + openapiRequiredFields.add("completed"); + openapiRequiredFields.add("update_time"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AsyncTaskStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AsyncTaskStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AsyncTaskStatus is not found in the empty JSON string", AsyncTaskStatus.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AsyncTaskStatus.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("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + // validate the optional field `error` + if (jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) { + Error.validateJsonElement(jsonObj.get("error")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AsyncTaskStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AsyncTaskStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AsyncTaskStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AsyncTaskStatus 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 AsyncTaskStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AsyncTaskStatus 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 AsyncTaskStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of AsyncTaskStatus + * @throws IOException if the JSON string is invalid with respect to AsyncTaskStatus + */ + public static AsyncTaskStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AsyncTaskStatus.class); + } + + /** + * Convert an instance of AsyncTaskStatus 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/CommitAsyncStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitAsyncStatus.java new file mode 100644 index 00000000000..fb4c0880b99 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitAsyncStatus.java @@ -0,0 +1,445 @@ +/* + * 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.Commit; +import io.lakefs.clients.sdk.model.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * CommitAsyncStatus + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitAsyncStatus { + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + private String taskId; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Boolean completed; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private OffsetDateTime updateTime; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private Error error; + + public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + private Commit result; + + public CommitAsyncStatus() { + } + + public CommitAsyncStatus taskId(String taskId) { + + this.taskId = taskId; + return this; + } + + /** + * the id of the async task + * @return taskId + **/ + @javax.annotation.Nonnull + public String getTaskId() { + return taskId; + } + + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + + public CommitAsyncStatus completed(Boolean completed) { + + this.completed = completed; + return this; + } + + /** + * true if the task has completed (either successfully or with an error) + * @return completed + **/ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + + public CommitAsyncStatus updateTime(OffsetDateTime updateTime) { + + this.updateTime = updateTime; + return this; + } + + /** + * last time the task status was updated + * @return updateTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(OffsetDateTime updateTime) { + this.updateTime = updateTime; + } + + + public CommitAsyncStatus error(Error error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public Error getError() { + return error; + } + + + public void setError(Error error) { + this.error = error; + } + + + public CommitAsyncStatus statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * an http status code that correlates with the underlying error if exists + * @return statusCode + **/ + @javax.annotation.Nullable + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + + public CommitAsyncStatus result(Commit result) { + + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @javax.annotation.Nullable + public Commit getResult() { + return result; + } + + + public void setResult(Commit result) { + this.result = result; + } + + /** + * 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 CommitAsyncStatus instance itself + */ + public CommitAsyncStatus 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; + } + CommitAsyncStatus commitAsyncStatus = (CommitAsyncStatus) o; + return Objects.equals(this.taskId, commitAsyncStatus.taskId) && + Objects.equals(this.completed, commitAsyncStatus.completed) && + Objects.equals(this.updateTime, commitAsyncStatus.updateTime) && + Objects.equals(this.error, commitAsyncStatus.error) && + Objects.equals(this.statusCode, commitAsyncStatus.statusCode) && + Objects.equals(this.result, commitAsyncStatus.result)&& + Objects.equals(this.additionalProperties, commitAsyncStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(taskId, completed, updateTime, error, statusCode, result, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitAsyncStatus {\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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("task_id"); + openapiFields.add("completed"); + openapiFields.add("update_time"); + openapiFields.add("error"); + openapiFields.add("status_code"); + openapiFields.add("result"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("task_id"); + openapiRequiredFields.add("completed"); + openapiRequiredFields.add("update_time"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitAsyncStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommitAsyncStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitAsyncStatus is not found in the empty JSON string", CommitAsyncStatus.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitAsyncStatus.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("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + // validate the optional field `error` + if (jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) { + Error.validateJsonElement(jsonObj.get("error")); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + Commit.validateJsonElement(jsonObj.get("result")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitAsyncStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitAsyncStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitAsyncStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitAsyncStatus 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 CommitAsyncStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CommitAsyncStatus 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 CommitAsyncStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitAsyncStatus + * @throws IOException if the JSON string is invalid with respect to CommitAsyncStatus + */ + public static CommitAsyncStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitAsyncStatus.class); + } + + /** + * Convert an instance of CommitAsyncStatus 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/MergeAsyncStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeAsyncStatus.java new file mode 100644 index 00000000000..ff4aa772afa --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeAsyncStatus.java @@ -0,0 +1,445 @@ +/* + * 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.Error; +import io.lakefs.clients.sdk.model.MergeResult; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.lakefs.clients.sdk.JSON; + +/** + * MergeAsyncStatus + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MergeAsyncStatus { + public static final String SERIALIZED_NAME_TASK_ID = "task_id"; + @SerializedName(SERIALIZED_NAME_TASK_ID) + private String taskId; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Boolean completed; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private OffsetDateTime updateTime; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private Error error; + + public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + private MergeResult result; + + public MergeAsyncStatus() { + } + + public MergeAsyncStatus taskId(String taskId) { + + this.taskId = taskId; + return this; + } + + /** + * the id of the async task + * @return taskId + **/ + @javax.annotation.Nonnull + public String getTaskId() { + return taskId; + } + + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + + public MergeAsyncStatus completed(Boolean completed) { + + this.completed = completed; + return this; + } + + /** + * true if the task has completed (either successfully or with an error) + * @return completed + **/ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + + public void setCompleted(Boolean completed) { + this.completed = completed; + } + + + public MergeAsyncStatus updateTime(OffsetDateTime updateTime) { + + this.updateTime = updateTime; + return this; + } + + /** + * last time the task status was updated + * @return updateTime + **/ + @javax.annotation.Nonnull + public OffsetDateTime getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(OffsetDateTime updateTime) { + this.updateTime = updateTime; + } + + + public MergeAsyncStatus error(Error error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public Error getError() { + return error; + } + + + public void setError(Error error) { + this.error = error; + } + + + public MergeAsyncStatus statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * an http status code that correlates with the underlying error if exists + * @return statusCode + **/ + @javax.annotation.Nullable + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + + public MergeAsyncStatus result(MergeResult result) { + + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @javax.annotation.Nullable + public MergeResult getResult() { + return result; + } + + + public void setResult(MergeResult result) { + this.result = result; + } + + /** + * 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 MergeAsyncStatus instance itself + */ + public MergeAsyncStatus 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; + } + MergeAsyncStatus mergeAsyncStatus = (MergeAsyncStatus) o; + return Objects.equals(this.taskId, mergeAsyncStatus.taskId) && + Objects.equals(this.completed, mergeAsyncStatus.completed) && + Objects.equals(this.updateTime, mergeAsyncStatus.updateTime) && + Objects.equals(this.error, mergeAsyncStatus.error) && + Objects.equals(this.statusCode, mergeAsyncStatus.statusCode) && + Objects.equals(this.result, mergeAsyncStatus.result)&& + Objects.equals(this.additionalProperties, mergeAsyncStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(taskId, completed, updateTime, error, statusCode, result, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeAsyncStatus {\n"); + sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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("task_id"); + openapiFields.add("completed"); + openapiFields.add("update_time"); + openapiFields.add("error"); + openapiFields.add("status_code"); + openapiFields.add("result"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("task_id"); + openapiRequiredFields.add("completed"); + openapiRequiredFields.add("update_time"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MergeAsyncStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MergeAsyncStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MergeAsyncStatus is not found in the empty JSON string", MergeAsyncStatus.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MergeAsyncStatus.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("task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); + } + // validate the optional field `error` + if (jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) { + Error.validateJsonElement(jsonObj.get("error")); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + MergeResult.validateJsonElement(jsonObj.get("result")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MergeAsyncStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MergeAsyncStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MergeAsyncStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MergeAsyncStatus 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 MergeAsyncStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MergeAsyncStatus 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 MergeAsyncStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of MergeAsyncStatus + * @throws IOException if the JSON string is invalid with respect to MergeAsyncStatus + */ + public static MergeAsyncStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MergeAsyncStatus.class); + } + + /** + * Convert an instance of MergeAsyncStatus 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 22800a9b0c3..c21481e88c9 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 @@ -16,6 +16,8 @@ import io.lakefs.clients.sdk.ApiException; import io.lakefs.clients.sdk.model.AbortPresignMultipartUpload; import io.lakefs.clients.sdk.model.AuthenticationToken; +import io.lakefs.clients.sdk.model.CommitAsyncStatus; +import io.lakefs.clients.sdk.model.CommitCreation; import io.lakefs.clients.sdk.model.CompletePresignMultipartUpload; import io.lakefs.clients.sdk.model.Error; import io.lakefs.clients.sdk.model.ExternalLoginInformation; @@ -23,6 +25,8 @@ import io.lakefs.clients.sdk.model.ExternalPrincipalCreation; import io.lakefs.clients.sdk.model.ExternalPrincipalList; import io.lakefs.clients.sdk.model.License; +import io.lakefs.clients.sdk.model.Merge; +import io.lakefs.clients.sdk.model.MergeAsyncStatus; import io.lakefs.clients.sdk.model.MergeResult; import io.lakefs.clients.sdk.model.ObjectStats; import io.lakefs.clients.sdk.model.PresignMultipartUpload; @@ -33,6 +37,7 @@ import io.lakefs.clients.sdk.model.PullRequestsList; import io.lakefs.clients.sdk.model.StagingLocation; import io.lakefs.clients.sdk.model.StsAuthRequest; +import io.lakefs.clients.sdk.model.TaskCreation; import io.lakefs.clients.sdk.model.UpdateObjectUserMetadata; import io.lakefs.clients.sdk.model.UploadPartCopyFrom; import io.lakefs.clients.sdk.model.UploadPartFrom; @@ -73,6 +78,38 @@ public void abortPresignMultipartUploadTest() throws ApiException { // TODO: test validations } + /** + * create commit asynchronously + * + * @throws ApiException if the Api call fails + */ + @Test + public void commitAsyncTest() throws ApiException { + String repository = null; + String branch = null; + CommitCreation commitCreation = null; + String sourceMetarange = null; + TaskCreation response = api.commitAsync(repository, branch, commitCreation) + .sourceMetarange(sourceMetarange) + .execute(); + // TODO: test validations + } + + /** + * get status of async commit operation + * + * @throws ApiException if the Api call fails + */ + @Test + public void commitAsyncStatusTest() throws ApiException { + String repository = null; + String branch = null; + String id = null; + CommitAsyncStatus response = api.commitAsyncStatus(repository, branch, id) + .execute(); + // TODO: test validations + } + /** * Complete a presign multipart upload request * @@ -293,6 +330,39 @@ public void listUserExternalPrincipalsTest() throws ApiException { // TODO: test validations } + /** + * merge references asynchronously + * + * @throws ApiException if the Api call fails + */ + @Test + public void mergeIntoBranchAsyncTest() throws ApiException { + String repository = null; + String sourceRef = null; + String destinationBranch = null; + Merge merge = null; + TaskCreation response = api.mergeIntoBranchAsync(repository, sourceRef, destinationBranch) + .merge(merge) + .execute(); + // TODO: test validations + } + + /** + * get status of async merge operation + * + * @throws ApiException if the Api call fails + */ + @Test + public void mergeIntoBranchAsyncStatusTest() throws ApiException { + String repository = null; + String sourceRef = null; + String destinationBranch = null; + String id = null; + MergeAsyncStatus response = api.mergeIntoBranchAsyncStatus(repository, sourceRef, destinationBranch, id) + .execute(); + // TODO: test validations + } + /** * merge pull request * diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/AsyncTaskStatusTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AsyncTaskStatusTest.java new file mode 100644 index 00000000000..52d3667dcd0 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/AsyncTaskStatusTest.java @@ -0,0 +1,82 @@ +/* + * 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.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AsyncTaskStatus + */ +public class AsyncTaskStatusTest { + private final AsyncTaskStatus model = new AsyncTaskStatus(); + + /** + * Model tests for AsyncTaskStatus + */ + @Test + public void testAsyncTaskStatus() { + // TODO: test AsyncTaskStatus + } + + /** + * Test the property 'taskId' + */ + @Test + public void taskIdTest() { + // TODO: test taskId + } + + /** + * Test the property 'completed' + */ + @Test + public void completedTest() { + // TODO: test completed + } + + /** + * Test the property 'updateTime' + */ + @Test + public void updateTimeTest() { + // TODO: test updateTime + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'statusCode' + */ + @Test + public void statusCodeTest() { + // TODO: test statusCode + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitAsyncStatusTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitAsyncStatusTest.java new file mode 100644 index 00000000000..1cb8f8f9cc4 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/CommitAsyncStatusTest.java @@ -0,0 +1,91 @@ +/* + * 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.Commit; +import io.lakefs.clients.sdk.model.Error; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommitAsyncStatus + */ +public class CommitAsyncStatusTest { + private final CommitAsyncStatus model = new CommitAsyncStatus(); + + /** + * Model tests for CommitAsyncStatus + */ + @Test + public void testCommitAsyncStatus() { + // TODO: test CommitAsyncStatus + } + + /** + * Test the property 'taskId' + */ + @Test + public void taskIdTest() { + // TODO: test taskId + } + + /** + * Test the property 'completed' + */ + @Test + public void completedTest() { + // TODO: test completed + } + + /** + * Test the property 'updateTime' + */ + @Test + public void updateTimeTest() { + // TODO: test updateTime + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'statusCode' + */ + @Test + public void statusCodeTest() { + // TODO: test statusCode + } + + /** + * Test the property 'result' + */ + @Test + public void resultTest() { + // TODO: test result + } + +} diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeAsyncStatusTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeAsyncStatusTest.java new file mode 100644 index 00000000000..580afad050c --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/MergeAsyncStatusTest.java @@ -0,0 +1,91 @@ +/* + * 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.Error; +import io.lakefs.clients.sdk.model.MergeResult; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MergeAsyncStatus + */ +public class MergeAsyncStatusTest { + private final MergeAsyncStatus model = new MergeAsyncStatus(); + + /** + * Model tests for MergeAsyncStatus + */ + @Test + public void testMergeAsyncStatus() { + // TODO: test MergeAsyncStatus + } + + /** + * Test the property 'taskId' + */ + @Test + public void taskIdTest() { + // TODO: test taskId + } + + /** + * Test the property 'completed' + */ + @Test + public void completedTest() { + // TODO: test completed + } + + /** + * Test the property 'updateTime' + */ + @Test + public void updateTimeTest() { + // TODO: test updateTime + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'statusCode' + */ + @Test + public void statusCodeTest() { + // TODO: test statusCode + } + + /** + * Test the property 'result' + */ + @Test + public void resultTest() { + // TODO: test result + } + +} diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES index 82b716b41e2..10d3c76e689 100644 --- a/clients/python/.openapi-generator/FILES +++ b/clients/python/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/AccessKeyCredentials.md docs/ActionRun.md docs/ActionRunList.md docs/ActionsApi.md +docs/AsyncTaskStatus.md docs/AuthApi.md docs/AuthCapabilities.md docs/AuthenticationToken.md @@ -19,6 +20,7 @@ docs/BranchesApi.md docs/CherryPickCreation.md docs/CommPrefsInput.md docs/Commit.md +docs/CommitAsyncStatus.md docs/CommitCreation.md docs/CommitList.md docs/CommitOverrides.md @@ -72,6 +74,7 @@ docs/LicenseApi.md docs/LoginConfig.md docs/LoginInformation.md docs/Merge.md +docs/MergeAsyncStatus.md docs/MergeResult.md docs/MetaRangeCreation.md docs/MetaRangeCreationResponse.md @@ -174,6 +177,7 @@ lakefs_sdk/models/access_key_credentials.py lakefs_sdk/models/acl.py lakefs_sdk/models/action_run.py lakefs_sdk/models/action_run_list.py +lakefs_sdk/models/async_task_status.py lakefs_sdk/models/auth_capabilities.py lakefs_sdk/models/authentication_token.py lakefs_sdk/models/branch_creation.py @@ -181,6 +185,7 @@ lakefs_sdk/models/branch_protection_rule.py lakefs_sdk/models/cherry_pick_creation.py lakefs_sdk/models/comm_prefs_input.py lakefs_sdk/models/commit.py +lakefs_sdk/models/commit_async_status.py lakefs_sdk/models/commit_creation.py lakefs_sdk/models/commit_list.py lakefs_sdk/models/commit_overrides.py @@ -226,6 +231,7 @@ lakefs_sdk/models/license.py lakefs_sdk/models/login_config.py lakefs_sdk/models/login_information.py lakefs_sdk/models/merge.py +lakefs_sdk/models/merge_async_status.py lakefs_sdk/models/merge_result.py lakefs_sdk/models/meta_range_creation.py lakefs_sdk/models/meta_range_creation_response.py @@ -302,6 +308,7 @@ test/test_acl.py test/test_action_run.py test/test_action_run_list.py test/test_actions_api.py +test/test_async_task_status.py test/test_auth_api.py test/test_auth_capabilities.py test/test_authentication_token.py @@ -311,6 +318,7 @@ test/test_branches_api.py test/test_cherry_pick_creation.py test/test_comm_prefs_input.py test/test_commit.py +test/test_commit_async_status.py test/test_commit_creation.py test/test_commit_list.py test/test_commit_overrides.py @@ -364,6 +372,7 @@ test/test_license_api.py test/test_login_config.py test/test_login_information.py test/test_merge.py +test/test_merge_async_status.py test/test_merge_result.py test/test_meta_range_creation.py test/test_meta_range_creation_response.py diff --git a/clients/python/README.md b/clients/python/README.md index d6ca0af0bcb..89f81b1f1ed 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -175,6 +175,8 @@ Class | Method | HTTP request | Description *CommitsApi* | [**get_commit**](docs/CommitsApi.md#get_commit) | **GET** /repositories/{repository}/commits/{commitId} | get commit *ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /config | *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* | [**commit_async**](docs/ExperimentalApi.md#commit_async) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously +*ExperimentalApi* | [**commit_async_status**](docs/ExperimentalApi.md#commit_async_status) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation *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 @@ -189,6 +191,8 @@ Class | Method | HTTP request | Description *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* | [**merge_into_branch_async**](docs/ExperimentalApi.md#merge_into_branch_async) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously +*ExperimentalApi* | [**merge_into_branch_async_status**](docs/ExperimentalApi.md#merge_into_branch_async_status) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation *ExperimentalApi* | [**merge_pull_request**](docs/ExperimentalApi.md#merge_pull_request) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request *ExperimentalApi* | [**release_token_to_mailbox**](docs/ExperimentalApi.md#release_token_to_mailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. *ExperimentalApi* | [**sts_login**](docs/ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS @@ -288,6 +292,7 @@ Class | Method | HTTP request | Description - [AccessKeyCredentials](docs/AccessKeyCredentials.md) - [ActionRun](docs/ActionRun.md) - [ActionRunList](docs/ActionRunList.md) + - [AsyncTaskStatus](docs/AsyncTaskStatus.md) - [AuthCapabilities](docs/AuthCapabilities.md) - [AuthenticationToken](docs/AuthenticationToken.md) - [BranchCreation](docs/BranchCreation.md) @@ -295,6 +300,7 @@ Class | Method | HTTP request | Description - [CherryPickCreation](docs/CherryPickCreation.md) - [CommPrefsInput](docs/CommPrefsInput.md) - [Commit](docs/Commit.md) + - [CommitAsyncStatus](docs/CommitAsyncStatus.md) - [CommitCreation](docs/CommitCreation.md) - [CommitList](docs/CommitList.md) - [CommitOverrides](docs/CommitOverrides.md) @@ -340,6 +346,7 @@ Class | Method | HTTP request | Description - [LoginConfig](docs/LoginConfig.md) - [LoginInformation](docs/LoginInformation.md) - [Merge](docs/Merge.md) + - [MergeAsyncStatus](docs/MergeAsyncStatus.md) - [MergeResult](docs/MergeResult.md) - [MetaRangeCreation](docs/MetaRangeCreation.md) - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) diff --git a/clients/python/docs/AsyncTaskStatus.md b/clients/python/docs/AsyncTaskStatus.md new file mode 100644 index 00000000000..4cce4e719b2 --- /dev/null +++ b/clients/python/docs/AsyncTaskStatus.md @@ -0,0 +1,33 @@ +# AsyncTaskStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **str** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **datetime** | last time the task status was updated | +**error** | [**Error**](Error.md) | | [optional] +**status_code** | **int** | an http status code that correlates with the underlying error if exists | [optional] + +## Example + +```python +from lakefs_sdk.models.async_task_status import AsyncTaskStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of AsyncTaskStatus from a JSON string +async_task_status_instance = AsyncTaskStatus.from_json(json) +# print the JSON string representation of the object +print AsyncTaskStatus.to_json() + +# convert the object into a dict +async_task_status_dict = async_task_status_instance.to_dict() +# create an instance of AsyncTaskStatus from a dict +async_task_status_form_dict = async_task_status.from_dict(async_task_status_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/CommitAsyncStatus.md b/clients/python/docs/CommitAsyncStatus.md new file mode 100644 index 00000000000..a342c141798 --- /dev/null +++ b/clients/python/docs/CommitAsyncStatus.md @@ -0,0 +1,34 @@ +# CommitAsyncStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **str** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **datetime** | last time the task status was updated | +**error** | [**Error**](Error.md) | | [optional] +**status_code** | **int** | an http status code that correlates with the underlying error if exists | [optional] +**result** | [**Commit**](Commit.md) | | [optional] + +## Example + +```python +from lakefs_sdk.models.commit_async_status import CommitAsyncStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of CommitAsyncStatus from a JSON string +commit_async_status_instance = CommitAsyncStatus.from_json(json) +# print the JSON string representation of the object +print CommitAsyncStatus.to_json() + +# convert the object into a dict +commit_async_status_dict = commit_async_status_instance.to_dict() +# create an instance of CommitAsyncStatus from a dict +commit_async_status_form_dict = commit_async_status.from_dict(commit_async_status_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/CommitsApi.md b/clients/python/docs/CommitsApi.md index 96479c4003e..7155847fff1 100644 --- a/clients/python/docs/CommitsApi.md +++ b/clients/python/docs/CommitsApi.md @@ -123,7 +123,7 @@ Name | Type | Description | Notes **403** | Forbidden | - | **404** | Resource Not Found | - | **409** | Resource Conflicts With Target | - | -**412** | Precondition Failed (e.g. a pre-commit hook returned a failure) | - | +**412** | Precondition Failed | - | **429** | too many requests | - | **0** | Internal Server Error | - | diff --git a/clients/python/docs/ExperimentalApi.md b/clients/python/docs/ExperimentalApi.md index cc53b0c3028..f396e687ead 100644 --- a/clients/python/docs/ExperimentalApi.md +++ b/clients/python/docs/ExperimentalApi.md @@ -5,6 +5,8 @@ All URIs are relative to */api/v1* 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 +[**commit_async**](ExperimentalApi.md#commit_async) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously +[**commit_async_status**](ExperimentalApi.md#commit_async_status) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation [**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 @@ -19,6 +21,8 @@ Method | HTTP request | Description [**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 +[**merge_into_branch_async**](ExperimentalApi.md#merge_into_branch_async) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously +[**merge_into_branch_async_status**](ExperimentalApi.md#merge_into_branch_async_status) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation [**merge_pull_request**](ExperimentalApi.md#merge_pull_request) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request [**release_token_to_mailbox**](ExperimentalApi.md#release_token_to_mailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. [**sts_login**](ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS @@ -147,6 +151,245 @@ 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) +# **commit_async** +> TaskCreation commit_async(repository, branch, commit_creation, source_metarange=source_metarange) + +create commit asynchronously + +### 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.commit_creation import CommitCreation +from lakefs_sdk.models.task_creation import TaskCreation +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 | + branch = 'branch_example' # str | + commit_creation = lakefs_sdk.CommitCreation() # CommitCreation | + source_metarange = 'source_metarange_example' # str | The source metarange to commit. Branch must not have uncommitted changes. (optional) + + try: + # create commit asynchronously + api_response = api_instance.commit_async(repository, branch, commit_creation, source_metarange=source_metarange) + print("The response of ExperimentalApi->commit_async:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->commit_async: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **commit_creation** | [**CommitCreation**](CommitCreation.md)| | + **source_metarange** | **str**| The source metarange to commit. Branch must not have uncommitted changes. | [optional] + +### Return type + +[**TaskCreation**](TaskCreation.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**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | commit task started | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**429** | too many requests | - | +**501** | Not Implemented | - | +**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) + +# **commit_async_status** +> CommitAsyncStatus commit_async_status(repository, branch, id) + +get status of async commit operation + +### 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.commit_async_status import CommitAsyncStatus +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 | + branch = 'branch_example' # str | + id = 'id_example' # str | Unique identifier of the commit async task + + try: + # get status of async commit operation + api_response = api_instance.commit_async_status(repository, branch, id) + print("The response of ExperimentalApi->commit_async_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->commit_async_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **id** | **str**| Unique identifier of the commit async task | + +### Return type + +[**CommitAsyncStatus**](CommitAsyncStatus.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** | commit task status | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**412** | Precondition Failed | - | +**429** | too many requests | - | +**501** | Not Implemented | - | +**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) + # **complete_presign_multipart_upload** > ObjectStats complete_presign_multipart_upload(repository, branch, upload_id, path, complete_presign_multipart_upload=complete_presign_multipart_upload) @@ -1629,6 +1872,247 @@ 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) +# **merge_into_branch_async** +> TaskCreation merge_into_branch_async(repository, source_ref, destination_branch, merge=merge) + +merge references asynchronously + +### 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.merge import Merge +from lakefs_sdk.models.task_creation import TaskCreation +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 | + source_ref = 'source_ref_example' # str | source ref + destination_branch = 'destination_branch_example' # str | destination branch name + merge = lakefs_sdk.Merge() # Merge | (optional) + + try: + # merge references asynchronously + api_response = api_instance.merge_into_branch_async(repository, source_ref, destination_branch, merge=merge) + print("The response of ExperimentalApi->merge_into_branch_async:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->merge_into_branch_async: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **source_ref** | **str**| source ref | + **destination_branch** | **str**| destination branch name | + **merge** | [**Merge**](Merge.md)| | [optional] + +### Return type + +[**TaskCreation**](TaskCreation.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**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | merge task started | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**429** | too many requests | - | +**501** | Not Implemented | - | +**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) + +# **merge_into_branch_async_status** +> MergeAsyncStatus merge_into_branch_async_status(repository, source_ref, destination_branch, id) + +get status of async merge operation + +### 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.merge_async_status import MergeAsyncStatus +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 | + source_ref = 'source_ref_example' # str | source ref + destination_branch = 'destination_branch_example' # str | destination branch name + id = 'id_example' # str | Unique identifier of the merge async task + + try: + # get status of async merge operation + api_response = api_instance.merge_into_branch_async_status(repository, source_ref, destination_branch, id) + print("The response of ExperimentalApi->merge_into_branch_async_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExperimentalApi->merge_into_branch_async_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **source_ref** | **str**| source ref | + **destination_branch** | **str**| destination branch name | + **id** | **str**| Unique identifier of the merge async task | + +### Return type + +[**MergeAsyncStatus**](MergeAsyncStatus.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** | merge task status | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**412** | Precondition Failed | - | +**429** | too many requests | - | +**501** | Not Implemented | - | +**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) + # **merge_pull_request** > MergeResult merge_pull_request(repository, pull_request) @@ -1739,7 +2223,7 @@ Name | Type | Description | Notes **403** | Forbidden | - | **404** | Resource Not Found | - | **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | -**412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +**412** | precondition failed | - | **429** | too many requests | - | **0** | Internal Server Error | - | diff --git a/clients/python/docs/MergeAsyncStatus.md b/clients/python/docs/MergeAsyncStatus.md new file mode 100644 index 00000000000..007f91aa5ec --- /dev/null +++ b/clients/python/docs/MergeAsyncStatus.md @@ -0,0 +1,34 @@ +# MergeAsyncStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **str** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **datetime** | last time the task status was updated | +**error** | [**Error**](Error.md) | | [optional] +**status_code** | **int** | an http status code that correlates with the underlying error if exists | [optional] +**result** | [**MergeResult**](MergeResult.md) | | [optional] + +## Example + +```python +from lakefs_sdk.models.merge_async_status import MergeAsyncStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of MergeAsyncStatus from a JSON string +merge_async_status_instance = MergeAsyncStatus.from_json(json) +# print the JSON string representation of the object +print MergeAsyncStatus.to_json() + +# convert the object into a dict +merge_async_status_dict = merge_async_status_instance.to_dict() +# create an instance of MergeAsyncStatus from a dict +merge_async_status_form_dict = merge_async_status.from_dict(merge_async_status_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 index b3344b38291..b7bc2f9c42e 100644 --- a/clients/python/docs/PullsApi.md +++ b/clients/python/docs/PullsApi.md @@ -469,7 +469,7 @@ Name | Type | Description | Notes **403** | Forbidden | - | **404** | Resource Not Found | - | **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult | - | -**412** | precondition failed (e.g. a pre-merge hook returned a failure) | - | +**412** | precondition failed | - | **429** | too many requests | - | **0** | Internal Server Error | - | diff --git a/clients/python/lakefs_sdk/__init__.py b/clients/python/lakefs_sdk/__init__.py index 3a19c718531..d34b51e7b91 100644 --- a/clients/python/lakefs_sdk/__init__.py +++ b/clients/python/lakefs_sdk/__init__.py @@ -55,6 +55,7 @@ from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.models.action_run_list import ActionRunList +from lakefs_sdk.models.async_task_status import AsyncTaskStatus from lakefs_sdk.models.auth_capabilities import AuthCapabilities from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.branch_creation import BranchCreation @@ -62,6 +63,7 @@ from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation from lakefs_sdk.models.comm_prefs_input import CommPrefsInput from lakefs_sdk.models.commit import Commit +from lakefs_sdk.models.commit_async_status import CommitAsyncStatus from lakefs_sdk.models.commit_creation import CommitCreation from lakefs_sdk.models.commit_list import CommitList from lakefs_sdk.models.commit_overrides import CommitOverrides @@ -107,6 +109,7 @@ from lakefs_sdk.models.login_config import LoginConfig from lakefs_sdk.models.login_information import LoginInformation from lakefs_sdk.models.merge import Merge +from lakefs_sdk.models.merge_async_status import MergeAsyncStatus from lakefs_sdk.models.merge_result import MergeResult from lakefs_sdk.models.meta_range_creation import MetaRangeCreation from lakefs_sdk.models.meta_range_creation_response import MetaRangeCreationResponse diff --git a/clients/python/lakefs_sdk/api/experimental_api.py b/clients/python/lakefs_sdk/api/experimental_api.py index f37f5a1fa0b..2a48efe16e0 100644 --- a/clients/python/lakefs_sdk/api/experimental_api.py +++ b/clients/python/lakefs_sdk/api/experimental_api.py @@ -32,6 +32,8 @@ from lakefs_sdk.models.abort_presign_multipart_upload import AbortPresignMultipartUpload from lakefs_sdk.models.authentication_token import AuthenticationToken +from lakefs_sdk.models.commit_async_status import CommitAsyncStatus +from lakefs_sdk.models.commit_creation import CommitCreation from lakefs_sdk.models.complete_presign_multipart_upload import CompletePresignMultipartUpload from lakefs_sdk.models.error import Error from lakefs_sdk.models.external_login_information import ExternalLoginInformation @@ -39,6 +41,8 @@ from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.models.license import License +from lakefs_sdk.models.merge import Merge +from lakefs_sdk.models.merge_async_status import MergeAsyncStatus from lakefs_sdk.models.merge_result import MergeResult from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload @@ -48,6 +52,7 @@ from lakefs_sdk.models.pull_request_creation_response import PullRequestCreationResponse from lakefs_sdk.models.pull_requests_list import PullRequestsList from lakefs_sdk.models.sts_auth_request import StsAuthRequest +from lakefs_sdk.models.task_creation import TaskCreation from lakefs_sdk.models.update_object_user_metadata import UpdateObjectUserMetadata from lakefs_sdk.models.upload_part_copy_from import UploadPartCopyFrom from lakefs_sdk.models.upload_part_from import UploadPartFrom @@ -251,26 +256,23 @@ def abort_presign_multipart_upload_with_http_info(self, repository : StrictStr, _request_auth=_params.get('_request_auth')) @validate_arguments - def complete_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ObjectStats: # noqa: E501 - """Complete a presign multipart upload request # noqa: E501 + def commit_async(self, repository : StrictStr, branch : StrictStr, commit_creation : CommitCreation, source_metarange : Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, **kwargs) -> TaskCreation: # noqa: E501 + """create commit asynchronously # 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, complete_presign_multipart_upload, async_req=True) + >>> thread = api.commit_async(repository, branch, commit_creation, source_metarange, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param upload_id: (required) - :type upload_id: str - :param path: relative to the branch (required) - :type path: str - :param complete_presign_multipart_upload: - :type complete_presign_multipart_upload: CompletePresignMultipartUpload + :param commit_creation: (required) + :type commit_creation: CommitCreation + :param source_metarange: The source metarange to commit. Branch must not have uncommitted changes. + :type source_metarange: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -280,35 +282,32 @@ def complete_presign_multipart_upload(self, repository : StrictStr, branch : Str :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: ObjectStats + :rtype: TaskCreation """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the complete_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the commit_async_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.complete_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, **kwargs) # noqa: E501 + return self.commit_async_with_http_info(repository, branch, commit_creation, source_metarange, **kwargs) # noqa: E501 @validate_arguments - def complete_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Complete a presign multipart upload request # noqa: E501 + def commit_async_with_http_info(self, repository : StrictStr, branch : StrictStr, commit_creation : CommitCreation, source_metarange : Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """create commit asynchronously # 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_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, async_req=True) + >>> thread = api.commit_async_with_http_info(repository, branch, commit_creation, source_metarange, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param upload_id: (required) - :type upload_id: str - :param path: relative to the branch (required) - :type path: str - :param complete_presign_multipart_upload: - :type complete_presign_multipart_upload: CompletePresignMultipartUpload + :param commit_creation: (required) + :type commit_creation: CommitCreation + :param source_metarange: The source metarange to commit. Branch must not have uncommitted changes. + :type source_metarange: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -331,7 +330,7 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(TaskCreation, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -339,9 +338,8 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt _all_params = [ 'repository', 'branch', - 'upload_id', - 'path', - 'complete_presign_multipart_upload' + 'commit_creation', + 'source_metarange' ] _all_params.extend( [ @@ -360,7 +358,7 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method complete_presign_multipart_upload" % _key + " to method commit_async" % _key ) _params[_key] = _val del _params['kwargs'] @@ -375,14 +373,11 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt if _params['branch']: _path_params['branch'] = _params['branch'] - if _params['upload_id']: - _path_params['uploadId'] = _params['upload_id'] - # process the query parameters _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + if _params.get('source_metarange') is not None: # noqa: E501 + _query_params.append(('source_metarange', _params['source_metarange'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) @@ -391,8 +386,8 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt _files = {} # process the body parameter _body_params = None - if _params['complete_presign_multipart_upload'] is not None: - _body_params = _params['complete_presign_multipart_upload'] + if _params['commit_creation'] is not None: + _body_params = _params['commit_creation'] # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( @@ -409,16 +404,17 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '200': "ObjectStats", + '202': "TaskCreation", '400': "Error", '401': "Error", + '403': "Error", '404': "Error", - '409': "StagingLocation", '429': None, + '501': "Error", } return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', 'PUT', + '/repositories/{repository}/branches/{branch}/commits/async', 'POST', _path_params, _query_params, _header_params, @@ -435,24 +431,21 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt _request_auth=_params.get('_request_auth')) @validate_arguments - def create_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> PresignMultipartUpload: # noqa: E501 - """Initiate a multipart upload # noqa: E501 + def commit_async_status(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the commit async task")], **kwargs) -> CommitAsyncStatus: # noqa: E501 + """get status of async commit operation # 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, parts, async_req=True) + >>> thread = api.commit_async_status(repository, branch, id, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param path: relative to the branch (required) - :type path: str - :param parts: number of presigned URL parts required to upload - :type parts: int + :param id: Unique identifier of the commit async task (required) + :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -462,33 +455,30 @@ def create_presign_multipart_upload(self, repository : StrictStr, branch : Stric :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: PresignMultipartUpload + :rtype: CommitAsyncStatus """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the create_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the commit_async_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.create_presign_multipart_upload_with_http_info(repository, branch, path, parts, **kwargs) # noqa: E501 + return self.commit_async_status_with_http_info(repository, branch, id, **kwargs) # noqa: E501 @validate_arguments - def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Initiate a multipart upload # noqa: E501 + def commit_async_status_with_http_info(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the commit async task")], **kwargs) -> ApiResponse: # noqa: E501 + """get status of async commit operation # 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_with_http_info(repository, branch, path, parts, async_req=True) + >>> thread = api.commit_async_status_with_http_info(repository, branch, id, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param path: relative to the branch (required) - :type path: str - :param parts: number of presigned URL parts required to upload - :type parts: int + :param id: Unique identifier of the commit async task (required) + :type 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 @@ -511,7 +501,7 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(PresignMultipartUpload, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(CommitAsyncStatus, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -519,8 +509,7 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, _all_params = [ 'repository', 'branch', - 'path', - 'parts' + 'id' ] _all_params.extend( [ @@ -539,7 +528,7 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_presign_multipart_upload" % _key + " to method commit_async_status" % _key ) _params[_key] = _val del _params['kwargs'] @@ -554,15 +543,12 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, if _params['branch']: _path_params['branch'] = _params['branch'] + if _params['id']: + _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - - if _params.get('parts') is not None: # noqa: E501 - _query_params.append(('parts', _params['parts'])) - # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -578,15 +564,19 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '201': "PresignMultipartUpload", + '200': "CommitAsyncStatus", '400': "Error", '401': "Error", + '403': "Error", '404': "Error", + '409': "Error", + '412': "Error", '429': None, + '501': "Error", } return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/pmpu', 'POST', + '/repositories/{repository}/branches/{branch}/commits/async/{id}/status', 'GET', _path_params, _query_params, _header_params, @@ -603,19 +593,26 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, _request_auth=_params.get('_request_auth')) @validate_arguments - def create_pull_request(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> PullRequestCreationResponse: # noqa: E501 - """create pull request # noqa: E501 + def complete_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ObjectStats: # noqa: E501 + """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.create_pull_request(repository, pull_request_creation, async_req=True) + >>> thread = api.complete_presign_multipart_upload(repository, branch, upload_id, path, complete_presign_multipart_upload, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str - :param pull_request_creation: (required) - :type pull_request_creation: PullRequestCreation + :param branch: (required) + :type branch: str + :param upload_id: (required) + :type upload_id: str + :param path: relative to the branch (required) + :type path: str + :param complete_presign_multipart_upload: + :type complete_presign_multipart_upload: CompletePresignMultipartUpload :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -625,28 +622,35 @@ def create_pull_request(self, repository : StrictStr, pull_request_creation : Pu :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: PullRequestCreationResponse + :rtype: ObjectStats """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the create_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the complete_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.create_pull_request_with_http_info(repository, pull_request_creation, **kwargs) # noqa: E501 + return self.complete_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, **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 + def complete_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ApiResponse: # noqa: E501 + """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.create_pull_request_with_http_info(repository, pull_request_creation, async_req=True) + >>> thread = api.complete_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, async_req=True) >>> result = thread.get() :param repository: (required) :type repository: str - :param pull_request_creation: (required) - :type pull_request_creation: PullRequestCreation + :param branch: (required) + :type branch: str + :param upload_id: (required) + :type upload_id: str + :param path: relative to the branch (required) + :type path: str + :param complete_presign_multipart_upload: + :type complete_presign_multipart_upload: CompletePresignMultipartUpload :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -669,14 +673,17 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(PullRequestCreationResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'repository', - 'pull_request_creation' + 'branch', + 'upload_id', + 'path', + 'complete_presign_multipart_upload' ] _all_params.extend( [ @@ -695,7 +702,7 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_pull_request" % _key + " to method complete_presign_multipart_upload" % _key ) _params[_key] = _val del _params['kwargs'] @@ -707,9 +714,18 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques if _params['repository']: _path_params['repository'] = _params['repository'] + if _params['branch']: + _path_params['branch'] = _params['branch'] + + if _params['upload_id']: + _path_params['uploadId'] = _params['upload_id'] + # process the query parameters _query_params = [] + if _params.get('path') is not None: # noqa: E501 + _query_params.append(('path', _params['path'])) + # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -717,8 +733,8 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques _files = {} # process the body parameter _body_params = None - if _params['pull_request_creation'] is not None: - _body_params = _params['pull_request_creation'] + if _params['complete_presign_multipart_upload'] is not None: + _body_params = _params['complete_presign_multipart_upload'] # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( @@ -735,17 +751,16 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '201': "PullRequestCreationResponse", + '200': "ObjectStats", '400': "Error", '401': "Error", - '403': "Error", '404': "Error", - '409': "Error", + '409': "StagingLocation", '429': None, } return self.api_client.call_api( - '/repositories/{repository}/pulls', 'POST', + '/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', 'PUT', _path_params, _query_params, _header_params, @@ -762,21 +777,24 @@ def create_pull_request_with_http_info(self, repository : StrictStr, pull_reques _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_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> PresignMultipartUpload: # noqa: E501 + """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_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) + >>> thread = api.create_presign_multipart_upload(repository, branch, path, parts, 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 branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param parts: number of presigned URL parts required to upload + :type parts: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -786,30 +804,33 @@ 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: PresignMultipartUpload """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the create_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 + return self.create_presign_multipart_upload_with_http_info(repository, branch, path, parts, **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_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """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_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) + >>> thread = api.create_presign_multipart_upload_with_http_info(repository, branch, path, parts, 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 branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param parts: number of presigned URL parts required to upload + :type parts: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -832,15 +853,16 @@ 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(PresignMultipartUpload, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'user_id', - 'principal_id', - 'external_principal_creation' + 'repository', + 'branch', + 'path', + 'parts' ] _all_params.extend( [ @@ -859,7 +881,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_presign_multipart_upload" % _key ) _params[_key] = _val del _params['kwargs'] @@ -868,14 +890,20 @@ 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'] + + if _params['branch']: + _path_params['branch'] = _params['branch'] # process the query parameters _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + if _params.get('path') is not None: # noqa: E501 + _query_params.append(('path', _params['path'])) + + if _params.get('parts') is not None: # noqa: E501 + _query_params.append(('parts', _params['parts'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) @@ -884,27 +912,23 @@ 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'] - # 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 = {} + _response_types_map = { + '201': "PresignMultipartUpload", + '400': "Error", + '401': "Error", + '404': "Error", + '429': None, + } return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'POST', + '/repositories/{repository}/branches/{branch}/staging/pmpu', 'POST', _path_params, _query_params, _header_params, @@ -921,19 +945,19 @@ 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_pull_request(self, repository : StrictStr, pull_request_creation : PullRequestCreation, **kwargs) -> PullRequestCreationResponse: # 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.delete_user_external_principal(user_id, principal_id, 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 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. @@ -943,28 +967,28 @@ def delete_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: PullRequestCreationResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the create_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 + return self.create_pull_request_with_http_info(repository, pull_request_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_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.delete_user_external_principal_with_http_info(user_id, principal_id, 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 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 @@ -987,14 +1011,14 @@ def delete_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(PullRequestCreationResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'user_id', - 'principal_id' + 'repository', + 'pull_request_creation' ] _all_params.extend( [ @@ -1013,7 +1037,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_pull_request" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1022,15 +1046,12 @@ def delete_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 @@ -1038,17 +1059,35 @@ def delete_user_external_principal_with_http_info(self, user_id : StrictStr, pri _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( ['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 = {} + _response_types_map = { + '201': "PullRequestCreationResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '429': None, + } return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'DELETE', + '/repositories/{repository}/pulls', 'POST', _path_params, _query_params, _header_params, @@ -1065,17 +1104,21 @@ 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 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.external_principal_login(external_login_information, async_req=True) + >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) >>> result = thread.get() - :param external_login_information: - :type external_login_information: ExternalLoginInformation + :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. @@ -1085,26 +1128,30 @@ 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: - message = "Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 + return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **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 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.external_principal_login_with_http_info(external_login_information, 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 external_login_information: - :type external_login_information: ExternalLoginInformation + :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 @@ -1127,13 +1174,15 @@ 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' + 'user_id', + 'principal_id', + 'external_principal_creation' ] _all_params.extend( [ @@ -1152,7 +1201,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 create_user_external_principal" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1161,9 +1210,15 @@ def external_principal_login_with_http_info(self, external_login_information : O # process the path parameters _path_params = {} + if _params['user_id']: + _path_params['userId'] = _params['user_id'] + # 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 @@ -1171,8 +1226,8 @@ 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'] + 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( @@ -1186,19 +1241,12 @@ def external_principal_login_with_http_info(self, external_login_information : O _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", - '429': None, - } + _response_types_map = {} return self.api_client.call_api( - '/auth/external/principal/login', 'POST', + '/auth/users/{userId}/external/principals', 'POST', _path_params, _query_params, _header_params, @@ -1215,15 +1263,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. @@ -1235,24 +1285,26 @@ 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: - message = "Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 + 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. @@ -1277,12 +1329,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( @@ -1302,7 +1355,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'] @@ -1311,6 +1364,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 = [] @@ -1331,16 +1387,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", - '400': "Error", - '401': "Error", - '404': "Error", - '429': 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, @@ -1357,16 +1407,17 @@ def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwar _request_auth=_params.get('_request_auth')) @validate_arguments - def get_license(self, **kwargs) -> License: # noqa: E501 - """get_license # 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 - retrieve lakeFS license information # 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_license(async_req=True) + >>> thread = api.external_principal_login(external_login_information, async_req=True) >>> result = thread.get() + :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. @@ -1376,25 +1427,26 @@ def get_license(self, **kwargs) -> License: # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: License + :rtype: AuthenticationToken """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the get_license_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.get_license_with_http_info(**kwargs) # noqa: E501 + return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 @validate_arguments - def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get_license # 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 - retrieve lakeFS license information # 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_license_with_http_info(async_req=True) + >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) >>> result = thread.get() + :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 @@ -1417,12 +1469,13 @@ def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(License, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ + 'external_login_information' ] _all_params.extend( [ @@ -1441,7 +1494,7 @@ def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_license" % _key + " to method external_principal_login" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1460,21 +1513,34 @@ def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 _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 = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings = [] # noqa: E501 _response_types_map = { - '200': "License", + '200': "AuthenticationToken", + '400': "Error", '401': "Error", - '501': "Error", + '403': "Error", + '404': "Error", + '429': None, } return self.api_client.call_api( - '/license', 'GET', + '/auth/external/principal/login', 'POST', _path_params, _query_params, _header_params, @@ -1491,19 +1557,17 @@ def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 _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 + 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_pull_request(repository, pull_request, async_req=True) + >>> thread = api.get_external_principal(principal_id, async_req=True) >>> result = thread.get() - :param repository: (required) - :type repository: str - :param pull_request: pull request id (required) - :type pull_request: str + :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. @@ -1513,28 +1577,26 @@ def get_pull_request(self, repository : StrictStr, pull_request : Annotated[Stri :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: PullRequest + :rtype: ExternalPrincipal """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the get_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.get_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 + return self.get_external_principal_with_http_info(principal_id, **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 + 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_pull_request_with_http_info(repository, pull_request, async_req=True) + >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) >>> result = thread.get() - :param repository: (required) - :type repository: str - :param pull_request: pull request id (required) - :type pull_request: str + :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 @@ -1557,14 +1619,13 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(PullRequest, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'repository', - 'pull_request' + 'principal_id' ] _all_params.extend( [ @@ -1583,7 +1644,7 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_pull_request" % _key + " to method get_external_principal" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1592,15 +1653,12 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : # 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 = [] + 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 @@ -1616,7 +1674,7 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '200': "PullRequest", + '200': "ExternalPrincipal", '400': "Error", '401': "Error", '404': "Error", @@ -1624,7 +1682,7 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : } return self.api_client.call_api( - '/repositories/{repository}/pulls/{pull_request}', 'GET', + '/auth/external/principals', 'GET', _path_params, _query_params, _header_params, @@ -1641,17 +1699,16 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : _request_auth=_params.get('_request_auth')) @validate_arguments - def get_token_from_mailbox(self, mailbox : Annotated[StrictStr, Field(..., description="mailbox returned by getTokenRedirect")], **kwargs) -> AuthenticationToken: # noqa: E501 - """receive the token after user has authenticated on redirect URL. # noqa: E501 + def get_license(self, **kwargs) -> License: # noqa: E501 + """get_license # noqa: E501 + retrieve lakeFS license information # 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_token_from_mailbox(mailbox, async_req=True) + >>> thread = api.get_license(async_req=True) >>> result = thread.get() - :param mailbox: mailbox returned by getTokenRedirect (required) - :type mailbox: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -1661,26 +1718,25 @@ def get_token_from_mailbox(self, mailbox : Annotated[StrictStr, Field(..., descr :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: AuthenticationToken + :rtype: License """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the get_token_from_mailbox_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the get_license_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.get_token_from_mailbox_with_http_info(mailbox, **kwargs) # noqa: E501 + return self.get_license_with_http_info(**kwargs) # noqa: E501 @validate_arguments - def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, Field(..., description="mailbox returned by getTokenRedirect")], **kwargs) -> ApiResponse: # noqa: E501 - """receive the token after user has authenticated on redirect URL. # noqa: E501 + def get_license_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """get_license # noqa: E501 + retrieve lakeFS license information # 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_token_from_mailbox_with_http_info(mailbox, async_req=True) + >>> thread = api.get_license_with_http_info(async_req=True) >>> result = thread.get() - :param mailbox: mailbox returned by getTokenRedirect (required) - :type mailbox: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1703,13 +1759,12 @@ def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, F :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(License, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'mailbox' ] _all_params.extend( [ @@ -1728,7 +1783,7 @@ def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, F if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_token_from_mailbox" % _key + " to method get_license" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1737,9 +1792,6 @@ def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, F # process the path parameters _path_params = {} - if _params['mailbox']: - _path_params['mailbox'] = _params['mailbox'] - # process the query parameters _query_params = [] @@ -1755,19 +1807,16 @@ def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, F ['application/json']) # noqa: E501 # 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", + '200': "License", '401': "Error", - '404': "Error", - '429': None, '501': "Error", } return self.api_client.call_api( - '/auth/get-token/mailboxes/{mailbox}', 'GET', + '/license', 'GET', _path_params, _query_params, _header_params, @@ -1784,15 +1833,19 @@ def get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, F _request_auth=_params.get('_request_auth')) @validate_arguments - def get_token_redirect(self, **kwargs) -> Error: # noqa: E501 - """start acquiring a token by logging in on a browser # noqa: E501 + 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_token_redirect(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. @@ -1802,24 +1855,28 @@ def get_token_redirect(self, **kwargs) -> Error: # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: Error + :rtype: PullRequest """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the get_token_redirect_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the get_pull_request_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.get_token_redirect_with_http_info(**kwargs) # noqa: E501 + return self.get_pull_request_with_http_info(repository, pull_request, **kwargs) # noqa: E501 @validate_arguments - def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """start acquiring a token by logging in on a browser # noqa: E501 + 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_token_redirect_with_http_info(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 @@ -1842,12 +1899,14 @@ def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(Error, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(PullRequest, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ + 'repository', + 'pull_request' ] _all_params.extend( [ @@ -1866,7 +1925,7 @@ def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_token_redirect" % _key + " to method get_pull_request" % _key ) _params[_key] = _val del _params['kwargs'] @@ -1875,6 +1934,12 @@ def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E # 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 = [] @@ -1890,17 +1955,18 @@ def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E ['application/json']) # noqa: E501 # authentication setting - _auth_settings = [] # noqa: E501 + _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '303': None, + '200': "PullRequest", + '400': "Error", '401': "Error", + '404': "Error", '429': None, - '501': "Error", } return self.api_client.call_api( - '/auth/get-token/start', 'GET', + '/repositories/{repository}/pulls/{pull_request}', 'GET', _path_params, _query_params, _header_params, @@ -1917,24 +1983,17 @@ def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E _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 get_token_from_mailbox(self, mailbox : Annotated[StrictStr, Field(..., description="mailbox returned by getTokenRedirect")], **kwargs) -> AuthenticationToken: # noqa: E501 + """receive the token after user has authenticated on redirect URL. # 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.get_token_from_mailbox(mailbox, 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 mailbox: mailbox returned by getTokenRedirect (required) + :type mailbox: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -1944,33 +2003,26 @@ 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: - message = "Error! Please call the hard_reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the get_token_from_mailbox_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.hard_reset_branch_with_http_info(repository, branch, ref, force, **kwargs) # noqa: E501 + return self.get_token_from_mailbox_with_http_info(mailbox, **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 get_token_from_mailbox_with_http_info(self, mailbox : Annotated[StrictStr, Field(..., description="mailbox returned by getTokenRedirect")], **kwargs) -> ApiResponse: # noqa: E501 + """receive the token after user has authenticated on redirect URL. # 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.get_token_from_mailbox_with_http_info(mailbox, 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 mailbox: mailbox returned by getTokenRedirect (required) + :type mailbox: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1993,16 +2045,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' + 'mailbox' ] _all_params.extend( [ @@ -2021,7 +2070,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 get_token_from_mailbox" % _key ) _params[_key] = _val del _params['kwargs'] @@ -2030,21 +2079,12 @@ 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'] + if _params['mailbox']: + _path_params['mailbox'] = _params['mailbox'] # 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 @@ -2057,12 +2097,19 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri ['application/json']) # noqa: E501 # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings = [] # noqa: E501 - _response_types_map = {} + _response_types_map = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '404': "Error", + '429': None, + '501': "Error", + } return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/hard_reset', 'PUT', + '/auth/get-token/mailboxes/{mailbox}', 'GET', _path_params, _query_params, _header_params, @@ -2079,25 +2126,15 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri _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, status : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 - """list pull requests # noqa: E501 + def get_token_redirect(self, **kwargs) -> Error: # noqa: E501 + """start acquiring a token by logging in on a browser # 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, status, async_req=True) + >>> thread = api.get_token_redirect(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 status: - :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -2107,34 +2144,24 @@ def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: PullRequestsList + :rtype: Error """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the get_token_redirect_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.list_pull_requests_with_http_info(repository, prefix, after, amount, status, **kwargs) # noqa: E501 + return self.get_token_redirect_with_http_info(**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, status : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list pull requests # noqa: E501 + def get_token_redirect_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """start acquiring a token by logging in on a browser # 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, status, async_req=True) + >>> thread = api.get_token_redirect_with_http_info(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 status: - :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -2157,17 +2184,12 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(PullRequestsList, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(Error, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'repository', - 'prefix', - 'after', - 'amount', - 'status' ] _all_params.extend( [ @@ -2186,7 +2208,7 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_pull_requests" % _key + " to method get_token_redirect" % _key ) _params[_key] = _val del _params['kwargs'] @@ -2195,24 +2217,9 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann # 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('status') is not None: # noqa: E501 - _query_params.append(('status', _params['status'])) - # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -2225,18 +2232,17 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann ['application/json']) # noqa: E501 # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings = [] # noqa: E501 _response_types_map = { - '200': "PullRequestsList", - '400': "Error", + '303': None, '401': "Error", - '404': "Error", '429': None, + '501': "Error", } return self.api_client.call_api( - '/repositories/{repository}/pulls', 'GET', + '/auth/get-token/start', 'GET', _path_params, _query_params, _header_params, @@ -2253,58 +2259,224 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann _request_auth=_params.get('_request_auth')) @validate_arguments - def list_user_external_principals(self, user_id : 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, **kwargs) -> ExternalPrincipalList: # noqa: E501 - """list user external policies attached to a user # noqa: E501 + 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.list_user_external_principals(user_id, prefix, after, amount, async_req=True) + >>> thread = api.hard_reset_branch(repository, branch, ref, force, async_req=True) >>> result = thread.get() - :param user_id: (required) - :type user_id: 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 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 + :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: ExternalPrincipalList + :rtype: None """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - message = "Error! Please call the list_user_external_principals_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + message = "Error! Please call the hard_reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.list_user_external_principals_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 + return self.hard_reset_branch_with_http_info(repository, branch, ref, force, **kwargs) # noqa: E501 @validate_arguments - def list_user_external_principals_with_http_info(self, user_id : 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, **kwargs) -> ApiResponse: # noqa: E501 - """list user external policies attached to a user # noqa: E501 + 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.list_user_external_principals_with_http_info(user_id, prefix, after, amount, async_req=True) + >>> thread = api.hard_reset_branch_with_http_info(repository, branch, ref, force, async_req=True) >>> result = thread.get() - :param user_id: (required) - :type user_id: str + :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, status : 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, status, 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 status: + :type status: 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: + message = "Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.list_pull_requests_with_http_info(repository, prefix, after, amount, status, **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, status : 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, status, 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 status: + :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -2327,16 +2499,17 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(ExternalPrincipalList, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(PullRequestsList, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ - 'user_id', + 'repository', 'prefix', 'after', - 'amount' + 'amount', + 'status' ] _all_params.extend( [ @@ -2355,7 +2528,7 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_user_external_principals" % _key + " to method list_pull_requests" % _key ) _params[_key] = _val del _params['kwargs'] @@ -2364,8 +2537,8 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref # 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 @@ -2379,6 +2552,9 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref if _params.get('amount') is not None: # noqa: E501 _query_params.append(('amount', _params['amount'])) + if _params.get('status') is not None: # noqa: E501 + _query_params.append(('status', _params['status'])) + # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -2394,7 +2570,7 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 _response_types_map = { - '200': "ExternalPrincipalList", + '200': "PullRequestsList", '400': "Error", '401': "Error", '404': "Error", @@ -2402,7 +2578,518 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref } return self.api_client.call_api( - '/auth/users/{userId}/external/principals/ls', 'GET', + '/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 list_user_external_principals(self, user_id : 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, **kwargs) -> ExternalPrincipalList: # noqa: E501 + """list user external policies attached to a 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.list_user_external_principals(user_id, prefix, after, amount, async_req=True) + >>> result = thread.get() + + :param user_id: (required) + :type user_id: 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 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: ExternalPrincipalList + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the list_user_external_principals_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.list_user_external_principals_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 + + @validate_arguments + def list_user_external_principals_with_http_info(self, user_id : 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, **kwargs) -> ApiResponse: # noqa: E501 + """list user external policies attached to a 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.list_user_external_principals_with_http_info(user_id, prefix, after, amount, async_req=True) + >>> result = thread.get() + + :param user_id: (required) + :type user_id: 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 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(ExternalPrincipalList, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'user_id', + 'prefix', + 'after', + 'amount' + ] + _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_user_external_principals" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['user_id']: + _path_params['userId'] = _params['user_id'] + + + # 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'])) + + # 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': "ExternalPrincipalList", + '400': "Error", + '401': "Error", + '404': "Error", + '429': None, + } + + return self.api_client.call_api( + '/auth/users/{userId}/external/principals/ls', '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 merge_into_branch_async(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> TaskCreation: # noqa: E501 + """merge references asynchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_into_branch_async(repository, source_ref, destination_branch, merge, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param merge: + :type merge: Merge + :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: TaskCreation + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the merge_into_branch_async_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.merge_into_branch_async_with_http_info(repository, source_ref, destination_branch, merge, **kwargs) # noqa: E501 + + @validate_arguments + def merge_into_branch_async_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> ApiResponse: # noqa: E501 + """merge references asynchronously # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_into_branch_async_with_http_info(repository, source_ref, destination_branch, merge, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param merge: + :type merge: Merge + :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(TaskCreation, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'source_ref', + 'destination_branch', + 'merge' + ] + _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 merge_into_branch_async" % _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['source_ref']: + _path_params['sourceRef'] = _params['source_ref'] + + if _params['destination_branch']: + _path_params['destinationBranch'] = _params['destination_branch'] + + + # 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['merge'] is not None: + _body_params = _params['merge'] + + # 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 = { + '202': "TaskCreation", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '429': None, + '501': "Error", + } + + return self.api_client.call_api( + '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async', '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 merge_into_branch_async_status(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], id : Annotated[StrictStr, Field(..., description="Unique identifier of the merge async task")], **kwargs) -> MergeAsyncStatus: # noqa: E501 + """get status of async merge operation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_into_branch_async_status(repository, source_ref, destination_branch, id, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param id: Unique identifier of the merge async task (required) + :type 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: MergeAsyncStatus + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the merge_into_branch_async_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.merge_into_branch_async_status_with_http_info(repository, source_ref, destination_branch, id, **kwargs) # noqa: E501 + + @validate_arguments + def merge_into_branch_async_status_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], id : Annotated[StrictStr, Field(..., description="Unique identifier of the merge async task")], **kwargs) -> ApiResponse: # noqa: E501 + """get status of async merge operation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_into_branch_async_status_with_http_info(repository, source_ref, destination_branch, id, async_req=True) + >>> result = thread.get() + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param id: Unique identifier of the merge async task (required) + :type 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(MergeAsyncStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'repository', + 'source_ref', + 'destination_branch', + '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 merge_into_branch_async_status" % _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['source_ref']: + _path_params['sourceRef'] = _params['source_ref'] + + if _params['destination_branch']: + _path_params['destinationBranch'] = _params['destination_branch'] + + if _params['id']: + _path_params['id'] = _params['id'] + + + # 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': "MergeAsyncStatus", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '412': "Error", + '429': None, + '501': "Error", + } + + return self.api_client.call_api( + '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status', 'GET', _path_params, _query_params, _header_params, diff --git a/clients/python/lakefs_sdk/models/__init__.py b/clients/python/lakefs_sdk/models/__init__.py index b1cd9f77e3b..a9aaf5a3e7a 100644 --- a/clients/python/lakefs_sdk/models/__init__.py +++ b/clients/python/lakefs_sdk/models/__init__.py @@ -20,6 +20,7 @@ from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.models.action_run_list import ActionRunList +from lakefs_sdk.models.async_task_status import AsyncTaskStatus from lakefs_sdk.models.auth_capabilities import AuthCapabilities from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.branch_creation import BranchCreation @@ -27,6 +28,7 @@ from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation from lakefs_sdk.models.comm_prefs_input import CommPrefsInput from lakefs_sdk.models.commit import Commit +from lakefs_sdk.models.commit_async_status import CommitAsyncStatus from lakefs_sdk.models.commit_creation import CommitCreation from lakefs_sdk.models.commit_list import CommitList from lakefs_sdk.models.commit_overrides import CommitOverrides @@ -72,6 +74,7 @@ from lakefs_sdk.models.login_config import LoginConfig from lakefs_sdk.models.login_information import LoginInformation from lakefs_sdk.models.merge import Merge +from lakefs_sdk.models.merge_async_status import MergeAsyncStatus from lakefs_sdk.models.merge_result import MergeResult from lakefs_sdk.models.meta_range_creation import MetaRangeCreation from lakefs_sdk.models.meta_range_creation_response import MetaRangeCreationResponse diff --git a/clients/python/lakefs_sdk/models/async_task_status.py b/clients/python/lakefs_sdk/models/async_task_status.py new file mode 100644 index 00000000000..c20b68cfed4 --- /dev/null +++ b/clients/python/lakefs_sdk/models/async_task_status.py @@ -0,0 +1,87 @@ +# 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 datetime import datetime +from typing import Optional +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from lakefs_sdk.models.error import Error + +class AsyncTaskStatus(BaseModel): + """ + AsyncTaskStatus + """ + task_id: StrictStr = Field(..., description="the id of the async task") + completed: StrictBool = Field(..., description="true if the task has completed (either successfully or with an error)") + update_time: datetime = Field(..., description="last time the task status was updated") + error: Optional[Error] = None + status_code: Optional[StrictInt] = Field(None, description="an http status code that correlates with the underlying error if exists") + __properties = ["task_id", "completed", "update_time", "error", "status_code"] + + 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) -> AsyncTaskStatus: + """Create an instance of AsyncTaskStatus 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 error + if self.error: + _dict['error'] = self.error.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> AsyncTaskStatus: + """Create an instance of AsyncTaskStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return AsyncTaskStatus.parse_obj(obj) + + _obj = AsyncTaskStatus.parse_obj({ + "task_id": obj.get("task_id"), + "completed": obj.get("completed"), + "update_time": obj.get("update_time"), + "error": Error.from_dict(obj.get("error")) if obj.get("error") is not None else None, + "status_code": obj.get("status_code") + }) + return _obj + + diff --git a/clients/python/lakefs_sdk/models/commit_async_status.py b/clients/python/lakefs_sdk/models/commit_async_status.py new file mode 100644 index 00000000000..b56427e4f5e --- /dev/null +++ b/clients/python/lakefs_sdk/models/commit_async_status.py @@ -0,0 +1,93 @@ +# 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 datetime import datetime +from typing import Optional +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from lakefs_sdk.models.commit import Commit +from lakefs_sdk.models.error import Error + +class CommitAsyncStatus(BaseModel): + """ + CommitAsyncStatus + """ + task_id: StrictStr = Field(..., description="the id of the async task") + completed: StrictBool = Field(..., description="true if the task has completed (either successfully or with an error)") + update_time: datetime = Field(..., description="last time the task status was updated") + error: Optional[Error] = None + status_code: Optional[StrictInt] = Field(None, description="an http status code that correlates with the underlying error if exists") + result: Optional[Commit] = None + __properties = ["task_id", "completed", "update_time", "error", "status_code", "result"] + + 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) -> CommitAsyncStatus: + """Create an instance of CommitAsyncStatus 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 error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CommitAsyncStatus: + """Create an instance of CommitAsyncStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CommitAsyncStatus.parse_obj(obj) + + _obj = CommitAsyncStatus.parse_obj({ + "task_id": obj.get("task_id"), + "completed": obj.get("completed"), + "update_time": obj.get("update_time"), + "error": Error.from_dict(obj.get("error")) if obj.get("error") is not None else None, + "status_code": obj.get("status_code"), + "result": Commit.from_dict(obj.get("result")) if obj.get("result") is not None else None + }) + return _obj + + diff --git a/clients/python/lakefs_sdk/models/merge_async_status.py b/clients/python/lakefs_sdk/models/merge_async_status.py new file mode 100644 index 00000000000..8aa2d41ff2d --- /dev/null +++ b/clients/python/lakefs_sdk/models/merge_async_status.py @@ -0,0 +1,93 @@ +# 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 datetime import datetime +from typing import Optional +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from lakefs_sdk.models.error import Error +from lakefs_sdk.models.merge_result import MergeResult + +class MergeAsyncStatus(BaseModel): + """ + MergeAsyncStatus + """ + task_id: StrictStr = Field(..., description="the id of the async task") + completed: StrictBool = Field(..., description="true if the task has completed (either successfully or with an error)") + update_time: datetime = Field(..., description="last time the task status was updated") + error: Optional[Error] = None + status_code: Optional[StrictInt] = Field(None, description="an http status code that correlates with the underlying error if exists") + result: Optional[MergeResult] = None + __properties = ["task_id", "completed", "update_time", "error", "status_code", "result"] + + 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) -> MergeAsyncStatus: + """Create an instance of MergeAsyncStatus 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 error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MergeAsyncStatus: + """Create an instance of MergeAsyncStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MergeAsyncStatus.parse_obj(obj) + + _obj = MergeAsyncStatus.parse_obj({ + "task_id": obj.get("task_id"), + "completed": obj.get("completed"), + "update_time": obj.get("update_time"), + "error": Error.from_dict(obj.get("error")) if obj.get("error") is not None else None, + "status_code": obj.get("status_code"), + "result": MergeResult.from_dict(obj.get("result")) if obj.get("result") is not None else None + }) + return _obj + + diff --git a/clients/python/test/test_async_task_status.py b/clients/python/test/test_async_task_status.py new file mode 100644 index 00000000000..0f05f35e1eb --- /dev/null +++ b/clients/python/test/test_async_task_status.py @@ -0,0 +1,61 @@ +# 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 + +from lakefs_sdk.models.async_task_status import AsyncTaskStatus # noqa: E501 + +class TestAsyncTaskStatus(unittest.TestCase): + """AsyncTaskStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AsyncTaskStatus: + """Test AsyncTaskStatus + 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 `AsyncTaskStatus` + """ + model = AsyncTaskStatus() # noqa: E501 + if include_optional: + return AsyncTaskStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error = lakefs_sdk.models.error.Error( + message = '', ), + status_code = 56 + ) + else: + return AsyncTaskStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testAsyncTaskStatus(self): + """Test AsyncTaskStatus""" + # 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_commit_async_status.py b/clients/python/test/test_commit_async_status.py new file mode 100644 index 00000000000..d30bac36fe6 --- /dev/null +++ b/clients/python/test/test_commit_async_status.py @@ -0,0 +1,75 @@ +# 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 + +from lakefs_sdk.models.commit_async_status import CommitAsyncStatus # noqa: E501 + +class TestCommitAsyncStatus(unittest.TestCase): + """CommitAsyncStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CommitAsyncStatus: + """Test CommitAsyncStatus + 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 `CommitAsyncStatus` + """ + model = CommitAsyncStatus() # noqa: E501 + if include_optional: + return CommitAsyncStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error = lakefs_sdk.models.error.Error( + message = '', ), + status_code = 56, + result = lakefs_sdk.models.commit.Commit( + id = '', + parents = [ + '' + ], + committer = '', + message = '', + creation_date = 56, + meta_range_id = '', + metadata = { + 'key' : '' + }, + generation = 56, + version = 0, ) + ) + else: + return CommitAsyncStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testCommitAsyncStatus(self): + """Test CommitAsyncStatus""" + # 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_experimental_api.py b/clients/python/test/test_experimental_api.py index 937e8573fc0..af84f27a9bd 100644 --- a/clients/python/test/test_experimental_api.py +++ b/clients/python/test/test_experimental_api.py @@ -34,6 +34,20 @@ def test_abort_presign_multipart_upload(self) -> None: """ pass + def test_commit_async(self) -> None: + """Test case for commit_async + + create commit asynchronously # noqa: E501 + """ + pass + + def test_commit_async_status(self) -> None: + """Test case for commit_async_status + + get status of async commit operation # noqa: E501 + """ + pass + def test_complete_presign_multipart_upload(self) -> None: """Test case for complete_presign_multipart_upload @@ -131,6 +145,20 @@ def test_list_user_external_principals(self) -> None: """ pass + def test_merge_into_branch_async(self) -> None: + """Test case for merge_into_branch_async + + merge references asynchronously # noqa: E501 + """ + pass + + def test_merge_into_branch_async_status(self) -> None: + """Test case for merge_into_branch_async_status + + get status of async merge operation # noqa: E501 + """ + pass + def test_merge_pull_request(self) -> None: """Test case for merge_pull_request diff --git a/clients/python/test/test_merge_async_status.py b/clients/python/test/test_merge_async_status.py new file mode 100644 index 00000000000..f7742a093bd --- /dev/null +++ b/clients/python/test/test_merge_async_status.py @@ -0,0 +1,63 @@ +# 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 + +from lakefs_sdk.models.merge_async_status import MergeAsyncStatus # noqa: E501 + +class TestMergeAsyncStatus(unittest.TestCase): + """MergeAsyncStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MergeAsyncStatus: + """Test MergeAsyncStatus + 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 `MergeAsyncStatus` + """ + model = MergeAsyncStatus() # noqa: E501 + if include_optional: + return MergeAsyncStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error = lakefs_sdk.models.error.Error( + message = '', ), + status_code = 56, + result = lakefs_sdk.models.merge_result.MergeResult( + reference = '', ) + ) + else: + return MergeAsyncStatus( + task_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testMergeAsyncStatus(self): + """Test MergeAsyncStatus""" + # 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/rust/.openapi-generator/FILES b/clients/rust/.openapi-generator/FILES index 1f0d16ec585..5ca3558efa1 100644 --- a/clients/rust/.openapi-generator/FILES +++ b/clients/rust/.openapi-generator/FILES @@ -9,6 +9,7 @@ docs/Acl.md docs/ActionRun.md docs/ActionRunList.md docs/ActionsApi.md +docs/AsyncTaskStatus.md docs/AuthApi.md docs/AuthCapabilities.md docs/AuthenticationToken.md @@ -18,6 +19,7 @@ docs/BranchesApi.md docs/CherryPickCreation.md docs/CommPrefsInput.md docs/Commit.md +docs/CommitAsyncStatus.md docs/CommitCreation.md docs/CommitList.md docs/CommitOverrides.md @@ -71,6 +73,7 @@ docs/LicenseApi.md docs/LoginConfig.md docs/LoginInformation.md docs/Merge.md +docs/MergeAsyncStatus.md docs/MergeResult.md docs/MetaRangeCreation.md docs/MetaRangeCreationResponse.md @@ -169,6 +172,7 @@ src/models/access_key_credentials.rs src/models/acl.rs src/models/action_run.rs src/models/action_run_list.rs +src/models/async_task_status.rs src/models/auth_capabilities.rs src/models/authentication_token.rs src/models/branch_creation.rs @@ -176,6 +180,7 @@ src/models/branch_protection_rule.rs src/models/cherry_pick_creation.rs src/models/comm_prefs_input.rs src/models/commit.rs +src/models/commit_async_status.rs src/models/commit_creation.rs src/models/commit_list.rs src/models/commit_overrides.rs @@ -221,6 +226,7 @@ src/models/license.rs src/models/login_config.rs src/models/login_information.rs src/models/merge.rs +src/models/merge_async_status.rs src/models/merge_result.rs src/models/meta_range_creation.rs src/models/meta_range_creation_response.rs diff --git a/clients/rust/README.md b/clients/rust/README.md index 33a419ac1df..986225788a1 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -82,6 +82,8 @@ Class | Method | HTTP request | Description *CommitsApi* | [**get_commit**](docs/CommitsApi.md#get_commit) | **GET** /repositories/{repository}/commits/{commitId} | get commit *ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /config | *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* | [**commit_async**](docs/ExperimentalApi.md#commit_async) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously +*ExperimentalApi* | [**commit_async_status**](docs/ExperimentalApi.md#commit_async_status) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation *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 @@ -96,6 +98,8 @@ Class | Method | HTTP request | Description *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* | [**merge_into_branch_async**](docs/ExperimentalApi.md#merge_into_branch_async) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously +*ExperimentalApi* | [**merge_into_branch_async_status**](docs/ExperimentalApi.md#merge_into_branch_async_status) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation *ExperimentalApi* | [**merge_pull_request**](docs/ExperimentalApi.md#merge_pull_request) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request *ExperimentalApi* | [**release_token_to_mailbox**](docs/ExperimentalApi.md#release_token_to_mailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. *ExperimentalApi* | [**sts_login**](docs/ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS @@ -195,6 +199,7 @@ Class | Method | HTTP request | Description - [Acl](docs/Acl.md) - [ActionRun](docs/ActionRun.md) - [ActionRunList](docs/ActionRunList.md) + - [AsyncTaskStatus](docs/AsyncTaskStatus.md) - [AuthCapabilities](docs/AuthCapabilities.md) - [AuthenticationToken](docs/AuthenticationToken.md) - [BranchCreation](docs/BranchCreation.md) @@ -202,6 +207,7 @@ Class | Method | HTTP request | Description - [CherryPickCreation](docs/CherryPickCreation.md) - [CommPrefsInput](docs/CommPrefsInput.md) - [Commit](docs/Commit.md) + - [CommitAsyncStatus](docs/CommitAsyncStatus.md) - [CommitCreation](docs/CommitCreation.md) - [CommitList](docs/CommitList.md) - [CommitOverrides](docs/CommitOverrides.md) @@ -247,6 +253,7 @@ Class | Method | HTTP request | Description - [LoginConfig](docs/LoginConfig.md) - [LoginInformation](docs/LoginInformation.md) - [Merge](docs/Merge.md) + - [MergeAsyncStatus](docs/MergeAsyncStatus.md) - [MergeResult](docs/MergeResult.md) - [MetaRangeCreation](docs/MetaRangeCreation.md) - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) diff --git a/clients/rust/docs/AsyncTaskStatus.md b/clients/rust/docs/AsyncTaskStatus.md new file mode 100644 index 00000000000..b8b77c49cdb --- /dev/null +++ b/clients/rust/docs/AsyncTaskStatus.md @@ -0,0 +1,15 @@ +# AsyncTaskStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **String** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **String** | last time the task status was updated | +**error** | Option<[**models::Error**](Error.md)> | | [optional] +**status_code** | Option<**i32**> | an http status code that correlates with the underlying error if exists | [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/CommitAsyncStatus.md b/clients/rust/docs/CommitAsyncStatus.md new file mode 100644 index 00000000000..5a1fc4d4f27 --- /dev/null +++ b/clients/rust/docs/CommitAsyncStatus.md @@ -0,0 +1,16 @@ +# CommitAsyncStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **String** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **String** | last time the task status was updated | +**error** | Option<[**models::Error**](Error.md)> | | [optional] +**status_code** | Option<**i32**> | an http status code that correlates with the underlying error if exists | [optional] +**result** | Option<[**models::Commit**](Commit.md)> | | [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/ExperimentalApi.md b/clients/rust/docs/ExperimentalApi.md index f732723328e..baa60ee8cb7 100644 --- a/clients/rust/docs/ExperimentalApi.md +++ b/clients/rust/docs/ExperimentalApi.md @@ -5,6 +5,8 @@ All URIs are relative to */api/v1* 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 +[**commit_async**](ExperimentalApi.md#commit_async) | **POST** /repositories/{repository}/branches/{branch}/commits/async | create commit asynchronously +[**commit_async_status**](ExperimentalApi.md#commit_async_status) | **GET** /repositories/{repository}/branches/{branch}/commits/async/{id}/status | get status of async commit operation [**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 @@ -19,6 +21,8 @@ Method | HTTP request | Description [**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 +[**merge_into_branch_async**](ExperimentalApi.md#merge_into_branch_async) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async | merge references asynchronously +[**merge_into_branch_async_status**](ExperimentalApi.md#merge_into_branch_async_status) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status | get status of async merge operation [**merge_pull_request**](ExperimentalApi.md#merge_pull_request) | **PUT** /repositories/{repository}/pulls/{pull_request}/merge | merge pull request [**release_token_to_mailbox**](ExperimentalApi.md#release_token_to_mailbox) | **GET** /auth/get-token/release-token/{loginRequestToken} | release a token for the current (authenticated) user to the mailbox of this login request. [**sts_login**](ExperimentalApi.md#sts_login) | **POST** /sts/login | perform a login with STS @@ -63,6 +67,67 @@ 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) +## commit_async + +> models::TaskCreation commit_async(repository, branch, commit_creation, source_metarange) +create commit asynchronously + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**branch** | **String** | | [required] | +**commit_creation** | [**CommitCreation**](CommitCreation.md) | | [required] | +**source_metarange** | Option<**String**> | The source metarange to commit. Branch must not have uncommitted changes. | | + +### Return type + +[**models::TaskCreation**](TaskCreation.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**: 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) + + +## commit_async_status + +> models::CommitAsyncStatus commit_async_status(repository, branch, id) +get status of async commit operation + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**branch** | **String** | | [required] | +**id** | **String** | Unique identifier of the commit async task | [required] | + +### Return type + +[**models::CommitAsyncStatus**](CommitAsyncStatus.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) + + ## complete_presign_multipart_upload > models::ObjectStats complete_presign_multipart_upload(repository, branch, upload_id, path, complete_presign_multipart_upload) @@ -479,6 +544,68 @@ 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) +## merge_into_branch_async + +> models::TaskCreation merge_into_branch_async(repository, source_ref, destination_branch, merge) +merge references asynchronously + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**source_ref** | **String** | source ref | [required] | +**destination_branch** | **String** | destination branch name | [required] | +**merge** | Option<[**Merge**](Merge.md)> | | | + +### Return type + +[**models::TaskCreation**](TaskCreation.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**: 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) + + +## merge_into_branch_async_status + +> models::MergeAsyncStatus merge_into_branch_async_status(repository, source_ref, destination_branch, id) +get status of async merge operation + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**repository** | **String** | | [required] | +**source_ref** | **String** | source ref | [required] | +**destination_branch** | **String** | destination branch name | [required] | +**id** | **String** | Unique identifier of the merge async task | [required] | + +### Return type + +[**models::MergeAsyncStatus**](MergeAsyncStatus.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) + + ## merge_pull_request > models::MergeResult merge_pull_request(repository, pull_request) diff --git a/clients/rust/docs/MergeAsyncStatus.md b/clients/rust/docs/MergeAsyncStatus.md new file mode 100644 index 00000000000..8a6f73ebb74 --- /dev/null +++ b/clients/rust/docs/MergeAsyncStatus.md @@ -0,0 +1,16 @@ +# MergeAsyncStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **String** | the id of the async task | +**completed** | **bool** | true if the task has completed (either successfully or with an error) | +**update_time** | **String** | last time the task status was updated | +**error** | Option<[**models::Error**](Error.md)> | | [optional] +**status_code** | Option<**i32**> | an http status code that correlates with the underlying error if exists | [optional] +**result** | Option<[**models::MergeResult**](MergeResult.md)> | | [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/src/apis/experimental_api.rs b/clients/rust/src/apis/experimental_api.rs index bc4a5e07032..19dfcb8733d 100644 --- a/clients/rust/src/apis/experimental_api.rs +++ b/clients/rust/src/apis/experimental_api.rs @@ -27,6 +27,36 @@ pub enum AbortPresignMultipartUploadError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`commit_async`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CommitAsyncError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status429(), + Status501(models::Error), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`commit_async_status`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CommitAsyncStatusError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status409(models::Error), + Status412(models::Error), + Status429(), + Status501(models::Error), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`complete_presign_multipart_upload`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -199,6 +229,36 @@ pub enum ListUserExternalPrincipalsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`merge_into_branch_async`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum MergeIntoBranchAsyncError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status429(), + Status501(models::Error), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`merge_into_branch_async_status`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum MergeIntoBranchAsyncStatusError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status409(models::Error), + Status412(models::Error), + Status429(), + Status501(models::Error), + DefaultResponse(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`merge_pull_request`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -322,6 +382,76 @@ pub async fn abort_presign_multipart_upload(configuration: &configuration::Confi } } +pub async fn commit_async(configuration: &configuration::Configuration, repository: &str, branch: &str, commit_creation: models::CommitCreation, source_metarange: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/branches/{branch}/commits/async", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), branch=crate::apis::urlencode(branch)); + 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_str) = source_metarange { + local_var_req_builder = local_var_req_builder.query(&[("source_metarange", &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()); + }; + local_var_req_builder = local_var_req_builder.json(&commit_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 commit_async_status(configuration: &configuration::Configuration, repository: &str, branch: &str, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/branches/{branch}/commits/async/{id}/status", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), branch=crate::apis::urlencode(branch), id=crate::apis::urlencode(id)); + 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)) + } +} + /// Completes a presign multipart upload by assembling the uploaded parts. pub async fn complete_presign_multipart_upload(configuration: &configuration::Configuration, repository: &str, branch: &str, upload_id: &str, path: &str, complete_presign_multipart_upload: Option) -> Result> { let local_var_configuration = configuration; @@ -807,6 +937,73 @@ pub async fn list_user_external_principals(configuration: &configuration::Config } } +pub async fn merge_into_branch_async(configuration: &configuration::Configuration, repository: &str, source_ref: &str, destination_branch: &str, merge: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), sourceRef=crate::apis::urlencode(source_ref), destinationBranch=crate::apis::urlencode(destination_branch)); + 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(&merge); + + 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 merge_into_branch_async_status(configuration: &configuration::Configuration, repository: &str, source_ref: &str, destination_branch: &str, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}/async/{id}/status", local_var_configuration.base_path, repository=crate::apis::urlencode(repository), sourceRef=crate::apis::urlencode(source_ref), destinationBranch=crate::apis::urlencode(destination_branch), id=crate::apis::urlencode(id)); + 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 merge_pull_request(configuration: &configuration::Configuration, repository: &str, pull_request: &str) -> Result> { let local_var_configuration = configuration; diff --git a/clients/rust/src/models/async_task_status.rs b/clients/rust/src/models/async_task_status.rs new file mode 100644 index 00000000000..55e1815846e --- /dev/null +++ b/clients/rust/src/models/async_task_status.rs @@ -0,0 +1,42 @@ +/* + * 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 AsyncTaskStatus { + /// the id of the async task + #[serde(rename = "task_id")] + pub task_id: String, + /// true if the task has completed (either successfully or with an error) + #[serde(rename = "completed")] + pub completed: bool, + /// last time the task status was updated + #[serde(rename = "update_time")] + pub update_time: String, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option>, + /// an http status code that correlates with the underlying error if exists + #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")] + pub status_code: Option, +} + +impl AsyncTaskStatus { + pub fn new(task_id: String, completed: bool, update_time: String) -> AsyncTaskStatus { + AsyncTaskStatus { + task_id, + completed, + update_time, + error: None, + status_code: None, + } + } +} + diff --git a/clients/rust/src/models/commit_async_status.rs b/clients/rust/src/models/commit_async_status.rs new file mode 100644 index 00000000000..6e2cf37c469 --- /dev/null +++ b/clients/rust/src/models/commit_async_status.rs @@ -0,0 +1,45 @@ +/* + * 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 CommitAsyncStatus { + /// the id of the async task + #[serde(rename = "task_id")] + pub task_id: String, + /// true if the task has completed (either successfully or with an error) + #[serde(rename = "completed")] + pub completed: bool, + /// last time the task status was updated + #[serde(rename = "update_time")] + pub update_time: String, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option>, + /// an http status code that correlates with the underlying error if exists + #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")] + pub status_code: Option, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option>, +} + +impl CommitAsyncStatus { + pub fn new(task_id: String, completed: bool, update_time: String) -> CommitAsyncStatus { + CommitAsyncStatus { + task_id, + completed, + update_time, + error: None, + status_code: None, + result: None, + } + } +} + diff --git a/clients/rust/src/models/merge_async_status.rs b/clients/rust/src/models/merge_async_status.rs new file mode 100644 index 00000000000..61c21fea342 --- /dev/null +++ b/clients/rust/src/models/merge_async_status.rs @@ -0,0 +1,45 @@ +/* + * 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 MergeAsyncStatus { + /// the id of the async task + #[serde(rename = "task_id")] + pub task_id: String, + /// true if the task has completed (either successfully or with an error) + #[serde(rename = "completed")] + pub completed: bool, + /// last time the task status was updated + #[serde(rename = "update_time")] + pub update_time: String, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option>, + /// an http status code that correlates with the underlying error if exists + #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")] + pub status_code: Option, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option>, +} + +impl MergeAsyncStatus { + pub fn new(task_id: String, completed: bool, update_time: String) -> MergeAsyncStatus { + MergeAsyncStatus { + task_id, + completed, + update_time, + error: None, + status_code: None, + result: None, + } + } +} + diff --git a/clients/rust/src/models/mod.rs b/clients/rust/src/models/mod.rs index a8f68bc2065..460f1be7f19 100644 --- a/clients/rust/src/models/mod.rs +++ b/clients/rust/src/models/mod.rs @@ -8,6 +8,8 @@ pub mod action_run; pub use self::action_run::ActionRun; pub mod action_run_list; pub use self::action_run_list::ActionRunList; +pub mod async_task_status; +pub use self::async_task_status::AsyncTaskStatus; pub mod auth_capabilities; pub use self::auth_capabilities::AuthCapabilities; pub mod authentication_token; @@ -22,6 +24,8 @@ pub mod comm_prefs_input; pub use self::comm_prefs_input::CommPrefsInput; pub mod commit; pub use self::commit::Commit; +pub mod commit_async_status; +pub use self::commit_async_status::CommitAsyncStatus; pub mod commit_creation; pub use self::commit_creation::CommitCreation; pub mod commit_list; @@ -112,6 +116,8 @@ pub mod login_information; pub use self::login_information::LoginInformation; pub mod merge; pub use self::merge::Merge; +pub mod merge_async_status; +pub use self::merge_async_status::MergeAsyncStatus; pub mod merge_result; pub use self::merge_result::MergeResult; pub mod meta_range_creation; diff --git a/cmd/lakefs/cmd/run.go b/cmd/lakefs/cmd/run.go index 0592efec19f..0d27a3534e4 100644 --- a/cmd/lakefs/cmd/run.go +++ b/cmd/lakefs/cmd/run.go @@ -160,10 +160,11 @@ var runCmd = &cobra.Command{ bufferedCollector.CollectMetadata(metadata) catalogConfig := catalog.Config{ - Config: cfg, - KVStore: kvStore, - PathProvider: upload.DefaultPathProvider, - ConflictResolvers: catalogfactory.BuildConflictResolvers(cfg, blockStore), + Config: cfg, + KVStore: kvStore, + PathProvider: upload.DefaultPathProvider, + ConflictResolvers: catalogfactory.BuildConflictResolvers(cfg, blockStore), + ErrorToStatusCodeAndMsg: api.ErrorToStatusAndMsg, } c, err := catalog.New(ctx, catalogConfig) @@ -172,6 +173,8 @@ var runCmd = &cobra.Command{ } defer func() { _ = c.Close() }() + catalogExtendedOps := catalogfactory.BuildExtendedOperations(c) + // Setup usage reporter - it is no longer possible to disable it usageReporter := stats.NewUsageReporter(metadata.InstallationID, kvStore) usageReporter.Start(ctx, baseCfg.UsageReport.FlushInterval, logger.WithField("service", "usage_report")) @@ -249,6 +252,7 @@ var runCmd = &cobra.Command{ migrator, bufferedCollector, actionsService, + catalogExtendedOps, auditChecker, logger.WithField("service", "api_gateway"), baseCfg.Gateways.S3.DomainNames, diff --git a/modules/catalog/factory/build.go b/modules/catalog/factory/build.go index f421062a154..acb9e79cdd7 100644 --- a/modules/catalog/factory/build.go +++ b/modules/catalog/factory/build.go @@ -2,6 +2,7 @@ package factory import ( "github.com/treeverse/lakefs/pkg/block" + "github.com/treeverse/lakefs/pkg/catalog" "github.com/treeverse/lakefs/pkg/config" "github.com/treeverse/lakefs/pkg/graveler" ) @@ -9,3 +10,7 @@ import ( func BuildConflictResolvers(cfg config.Config, block block.Adapter) []graveler.ConflictResolver { return nil } + +func BuildExtendedOperations(_ *catalog.Catalog) catalog.ExtendedOperations { + return catalog.NewNoopExtendedOperations() +} diff --git a/pkg/api/controller.go b/pkg/api/controller.go index ee44bcb4415..a7947d3a198 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -102,6 +102,7 @@ type Controller struct { Migrator Migrator Collector stats.Collector Actions actionsHandler + catalogExtendedOps catalog.ExtendedOperations AuditChecker AuditChecker Logger logging.Logger sessionStore sessions.Store @@ -125,6 +126,7 @@ func NewController( migrator Migrator, collector stats.Collector, actions actionsHandler, + catalogExtendedOps catalog.ExtendedOperations, auditChecker AuditChecker, logger logging.Logger, sessionStore sessions.Store, @@ -145,6 +147,7 @@ func NewController( Migrator: migrator, Collector: collector, Actions: actions, + catalogExtendedOps: catalogExtendedOps, AuditChecker: auditChecker, Logger: logger, sessionStore: sessionStore, @@ -3101,7 +3104,22 @@ func (c *Controller) GetBranch(w http.ResponseWriter, r *http.Request, repositor writeResponse(w, r, http.StatusOK, response) } -func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.ResponseWriter, r *http.Request, err error, cb func(w http.ResponseWriter, r *http.Request, code int, v interface{})) bool { +// ErrorToStatusAndMsg converts errors to HTTP status codes and messages for non-HTTP contexts. +// This function is used as a callback by the catalog layer to classify errors in background tasks +// (such as async commits and merges) before storing them in task status records. It maps domain-specific +// errors to appropriate HTTP status codes following the same classification rules as HTTP API handlers. +func ErrorToStatusAndMsg(logger logging.Logger, err error) (status int, msg string, ok bool) { + ok = handleApiErrorCallback(logger, nil, nil, err, func(w http.ResponseWriter, r *http.Request, code int, v interface{}) { + status = code + if v != nil { + msg = fmt.Sprintf("%v", v) + } + }) + return status, msg, ok +} + +// handleApiErrorCallback is a standalone function that handles API errors and maps them to appropriate HTTP status codes. +func handleApiErrorCallback(log logging.Logger, w http.ResponseWriter, r *http.Request, err error, cb func(w http.ResponseWriter, r *http.Request, code int, v interface{})) bool { // verify if request canceled even if there is no error, early exit point if httputil.IsRequestCanceled(r) { cb(w, r, httputil.HttpStatusClientClosedRequest, httputil.HttpStatusClientClosedRequestText) @@ -3111,8 +3129,6 @@ func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.Response return false } - log := c.Logger.WithContext(ctx).WithError(err) - // order of case is important, more specific errors should be first switch { case errors.Is(err, graveler.ErrLinkAddressInvalid), @@ -3189,25 +3205,31 @@ func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.Response case errors.Is(err, graveler.ErrTooManyTries): log.Debug("Retried too many times") cb(w, r, http.StatusTooManyRequests, "Too many attempts, try again later") + case errors.Is(err, kv.ErrSlowDown): log.Debug("KV Throttling") cb(w, r, http.StatusServiceUnavailable, "Throughput exceeded. Slow down and retry") + case errors.Is(err, graveler.ErrPreconditionFailed): log.Debug("Precondition failed") cb(w, r, http.StatusPreconditionFailed, "Precondition failed") + case errors.Is(err, authentication.ErrNotImplemented), errors.Is(err, auth.ErrNotImplemented), errors.Is(err, license.ErrNotImplemented), errors.Is(err, catalog.ErrNotImplemented): cb(w, r, http.StatusNotImplemented, "Not implemented") + case errors.Is(err, authentication.ErrInsufficientPermissions): - c.Logger.WithContext(ctx).WithError(err).Info("User verification failed - insufficient permissions") + log.Info("User verification failed - insufficient permissions") cb(w, r, http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized)) + case errors.Is(err, actions.ErrActionFailed): log.WithError(err).Debug("Precondition failed, aborted by action failure") cb(w, r, http.StatusPreconditionFailed, err) + default: - c.Logger.WithContext(ctx).WithError(err).Error("API call returned status internal server error") + log.Error("API call returned status internal server error") cb(w, r, http.StatusInternalServerError, err) } @@ -3215,7 +3237,8 @@ func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.Response } func (c *Controller) handleAPIError(ctx context.Context, w http.ResponseWriter, r *http.Request, err error) bool { - return c.handleAPIErrorCallback(ctx, w, r, err, writeError) + log := c.Logger.WithContext(ctx).WithError(err) + return handleApiErrorCallback(log, w, r, err, writeError) } func (c *Controller) ResetBranch(w http.ResponseWriter, r *http.Request, body apigen.ResetBranchJSONRequestBody, repository, branch string) { @@ -3460,6 +3483,89 @@ func (c *Controller) Commit(w http.ResponseWriter, r *http.Request, body apigen. commitResponse(w, r, newCommit) } +func (c *Controller) CommitAsync(w http.ResponseWriter, r *http.Request, body apigen.CommitAsyncJSONRequestBody, repository, branch string, params apigen.CommitAsyncParams) { + if !c.authorize(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.CreateCommitAction, + Resource: permissions.BranchArn(repository, branch), + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "create_commit_async", r, repository, branch, "") + user, err := auth.GetUser(ctx) + if err != nil { + writeError(w, r, http.StatusUnauthorized, "user not found") + return + } + var metadata map[string]string + if body.Metadata != nil { + metadata = body.Metadata.AdditionalProperties + } + + taskID, err := c.catalogExtendedOps.SubmitCommit(ctx, repository, branch, body.Message, user.Committer(), metadata, body.Date, params.SourceMetarange, swag.BoolValue(body.AllowEmpty), graveler.WithForce(swag.BoolValue(body.Force))) + if c.handleAPIError(ctx, w, r, err) { + return + } + writeResponse(w, r, http.StatusAccepted, apigen.TaskCreation{ + Id: taskID, + }) +} + +func (c *Controller) CommitAsyncStatus(w http.ResponseWriter, r *http.Request, repository, branch, id string) { + if !c.authorize(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.CreateCommitAction, + Resource: permissions.BranchArn(repository, branch), + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "create_commit_async_status", r, repository, branch, "") + taskID := id + status, err := c.catalogExtendedOps.GetCommitStatus(ctx, repository, taskID) + if c.handleAPIError(ctx, w, r, err) { + return + } + + resp := apigen.CommitAsyncStatus{ + AsyncTaskStatus: apigen.AsyncTaskStatus{ + TaskId: status.Task.Id, + Completed: status.Task.Done, + }, + } + if status.Task.UpdatedAt != nil { + resp.UpdateTime = status.Task.UpdatedAt.AsTime() + } + + if status.Task.ErrorMsg != "" { + resp.Error = &apigen.Error{ + Message: status.Task.ErrorMsg, + } + resp.StatusCode = apiutil.Ptr(status.Task.StatusCode) + } + + if status.Info != nil { + resp.Result = &apigen.Commit{ + Id: status.Info.Id, + Parents: status.Info.Parents, + Committer: status.Info.Committer, + Message: status.Info.Message, + CreationDate: status.Info.CreationDate.AsTime().Unix(), + MetaRangeId: status.Info.MetaRangeId, + Metadata: &apigen.Commit_Metadata{ + AdditionalProperties: status.Info.Metadata, + }, + Generation: apiutil.Ptr(int64(status.Info.Generation)), + Version: apiutil.Ptr(int(status.Info.Version)), + } + } + + writeResponse(w, r, http.StatusOK, resp) +} + func (c *Controller) CreateCommitRecord(w http.ResponseWriter, r *http.Request, body apigen.CreateCommitRecordJSONRequestBody, repository string) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ @@ -4143,9 +4249,9 @@ func (c *Controller) PrepareGarbageCollectionCommitsStatus(w http.ResponseWriter resp.UpdateTime = status.Task.UpdatedAt.AsTime() } - if status.Task.Error != "" { + if status.Task.ErrorMsg != "" { resp.Error = &apigen.Error{ - Message: status.Task.Error, + Message: status.Task.ErrorMsg, } } @@ -4547,8 +4653,8 @@ func (c *Controller) DumpStatus(w http.ResponseWriter, r *http.Request, reposito Done: status.Task.Done, UpdateTime: status.Task.UpdatedAt.AsTime(), } - if status.Task.Error != "" { - response.Error = apiutil.Ptr(status.Task.Error) + if status.Task.ErrorMsg != "" { + response.Error = apiutil.Ptr(status.Task.ErrorMsg) } if status.Task.Done && status.Info != nil { response.Refs = &apigen.RefsDump{ @@ -4648,8 +4754,8 @@ func (c *Controller) RestoreStatus(w http.ResponseWriter, r *http.Request, repos Done: status.Task.Done, UpdateTime: status.Task.UpdatedAt.AsTime(), } - if status.Task.Error != "" { - response.Error = apiutil.Ptr(status.Task.Error) + if status.Task.ErrorMsg != "" { + response.Error = apiutil.Ptr(status.Task.ErrorMsg) } writeResponse(w, r, http.StatusOK, response) } @@ -4870,7 +4976,8 @@ func (c *Controller) HeadObject(w http.ResponseWriter, r *http.Request, reposito // read the FS entry entry, err := c.Catalog.GetEntry(ctx, repository, ref, params.Path, catalog.GetEntryParams{}) if err != nil { - c.handleAPIErrorCallback(ctx, w, r, err, func(w http.ResponseWriter, r *http.Request, code int, v interface{}) { + log := c.Logger.WithContext(ctx).WithError(err) + handleApiErrorCallback(log, w, r, err, func(w http.ResponseWriter, r *http.Request, code int, v interface{}) { writeResponse(w, r, code, nil) }) return @@ -5396,6 +5503,89 @@ func (c *Controller) MergeIntoBranch(w http.ResponseWriter, r *http.Request, bod }) } +func (c *Controller) MergeIntoBranchAsync(w http.ResponseWriter, r *http.Request, body apigen.MergeIntoBranchAsyncJSONRequestBody, repository, sourceRef, destinationBranch string) { + if !c.authorize(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.CreateCommitAction, + Resource: permissions.BranchArn(repository, destinationBranch), + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "merge_branches_async", r, repository, destinationBranch, sourceRef) + user, err := auth.GetUser(ctx) + if err != nil { + writeError(w, r, http.StatusUnauthorized, "user not found") + return + } + metadata := map[string]string{} + if body.Metadata != nil { + metadata = body.Metadata.AdditionalProperties + } + + taskID, err := c.catalogExtendedOps.SubmitMergeIntoBranch(ctx, + repository, destinationBranch, sourceRef, + user.Committer(), + swag.StringValue(body.Message), + metadata, + swag.StringValue(body.Strategy), + graveler.WithForce(swag.BoolValue(body.Force)), + graveler.WithAllowEmpty(swag.BoolValue(body.AllowEmpty)), + graveler.WithSquashMerge(swag.BoolValue(body.SquashMerge)), + ) + + if c.handleAPIError(ctx, w, r, err) { + return + } + writeResponse(w, r, http.StatusAccepted, apigen.TaskCreation{ + Id: taskID, + }) +} + +func (c *Controller) MergeIntoBranchAsyncStatus(w http.ResponseWriter, r *http.Request, repository, sourceRef, destinationBranch, id string) { + if !c.authorize(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.CreateCommitAction, + Resource: permissions.BranchArn(repository, destinationBranch), + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "merge_branches_async_status", r, repository, destinationBranch, sourceRef) + taskID := id + status, err := c.catalogExtendedOps.GetMergeIntoBranchStatus(ctx, repository, taskID) + if c.handleAPIError(ctx, w, r, err) { + return + } + + resp := apigen.MergeAsyncStatus{ + AsyncTaskStatus: apigen.AsyncTaskStatus{ + TaskId: status.Task.Id, + Completed: status.Task.Done, + }, + } + if status.Task.UpdatedAt != nil { + resp.UpdateTime = status.Task.UpdatedAt.AsTime() + } + + if status.Task.ErrorMsg != "" { + resp.Error = &apigen.Error{ + Message: status.Task.ErrorMsg, + } + resp.StatusCode = apiutil.Ptr(status.Task.StatusCode) + } + + if status.Info != nil { + resp.Result = &apigen.MergeResult{ + Reference: status.Info.Reference, + } + } + + writeResponse(w, r, http.StatusOK, resp) +} + func (c *Controller) FindMergeBase(w http.ResponseWriter, r *http.Request, repository string, sourceRef string, destinationRef string) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ diff --git a/pkg/api/serve.go b/pkg/api/serve.go index b91b584d033..f34f202538c 100644 --- a/pkg/api/serve.go +++ b/pkg/api/serve.go @@ -45,6 +45,7 @@ func Serve( migrator Migrator, collector stats.Collector, actions actionsHandler, + catalogExtendedOps catalog.ExtendedOperations, auditChecker AuditChecker, logger logging.Logger, gatewayDomains []string, @@ -88,6 +89,7 @@ func Serve( migrator, collector, actions, + catalogExtendedOps, auditChecker, logger, sessionStore, diff --git a/pkg/api/serve_test.go b/pkg/api/serve_test.go index 7f6296a3739..63c67b186f8 100644 --- a/pkg/api/serve_test.go +++ b/pkg/api/serve_test.go @@ -186,6 +186,7 @@ func setupHandler(t testing.TB) (http.Handler, *dependencies) { migrator, collector, actionsService, + catalog.NewNoopExtendedOperations(), auditChecker, logger, nil, diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 2d83a101d60..710257ff2db 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -234,23 +234,27 @@ type Config struct { SettingsManagerOption settings.ManagerOption PathProvider *upload.PathPartitionProvider // ConflictResolvers alternative conflict resolvers (if nil, the default behavior is kept) - ConflictResolvers []graveler.ConflictResolver + ConflictResolvers []graveler.ConflictResolver + ErrorToStatusCodeAndMsg ErrorToStatusCodeAndMsg } +type ErrorToStatusCodeAndMsg func(logger logging.Logger, err error) (status int, msg string, ok bool) + type Catalog struct { - BlockAdapter block.Adapter - Store Store - managers []io.Closer - workPool pond.Pool - PathProvider *upload.PathPartitionProvider - BackgroundLimiter ratelimit.Limiter - KVStore kv.Store - KVStoreLimited kv.Store - addressProvider *ident.HexAddressProvider - deleteSensor *graveler.DeleteSensor - UGCPrepareMaxFileSize int64 - UGCPrepareInterval time.Duration - signingKey config.SecureString + BlockAdapter block.Adapter + Store Store + managers []io.Closer + workPool pond.Pool + PathProvider *upload.PathPartitionProvider + BackgroundLimiter ratelimit.Limiter + KVStore kv.Store + KVStoreLimited kv.Store + addressProvider *ident.HexAddressProvider + deleteSensor *graveler.DeleteSensor + UGCPrepareMaxFileSize int64 + UGCPrepareInterval time.Duration + signingKey config.SecureString + errorToStatusCodeAndMsg ErrorToStatusCodeAndMsg } const ( @@ -417,20 +421,28 @@ func New(ctx context.Context, cfg Config) (*Catalog, error) { WorkPool: workPool, }) closers = append(closers, &ctxCloser{cancelFn}) + + errToStatusFunc := cfg.ErrorToStatusCodeAndMsg + if errToStatusFunc == nil { + // Default implementation (needed in case a service that is not the controller initializes it) + errToStatusFunc = defaultErrorToStatusCodeAndMsg + } + return &Catalog{ - BlockAdapter: tierFSParams.Adapter, - Store: gStore, - UGCPrepareMaxFileSize: baseCfg.UGC.PrepareMaxFileSize, - UGCPrepareInterval: baseCfg.UGC.PrepareInterval, - PathProvider: cfg.PathProvider, - BackgroundLimiter: limiter, - workPool: workPool, - KVStore: cfg.KVStore, - managers: closers, - KVStoreLimited: storeLimiter, - addressProvider: addressProvider, - deleteSensor: deleteSensor, - signingKey: cfg.Config.StorageConfig().SigningKey(), + BlockAdapter: tierFSParams.Adapter, + Store: gStore, + UGCPrepareMaxFileSize: baseCfg.UGC.PrepareMaxFileSize, + UGCPrepareInterval: baseCfg.UGC.PrepareInterval, + PathProvider: cfg.PathProvider, + BackgroundLimiter: limiter, + workPool: workPool, + KVStore: cfg.KVStore, + managers: closers, + KVStoreLimited: storeLimiter, + addressProvider: addressProvider, + deleteSensor: deleteSensor, + signingKey: cfg.Config.StorageConfig().SigningKey(), + errorToStatusCodeAndMsg: errToStatusFunc, }, nil } @@ -499,6 +511,13 @@ func newLimiter(rateLimit int) ratelimit.Limiter { return limiter } +func defaultErrorToStatusCodeAndMsg(logger logging.Logger, err error) (status int, msg string, ok bool) { + if err == nil { + return 0, "", false + } + return 0, err.Error(), true +} + func (c *Catalog) SetHooksHandler(hooks graveler.HooksHandler) { c.Store.SetHooksHandler(hooks) } @@ -2104,7 +2123,7 @@ func (c *Catalog) DumpRepositorySubmit(ctx context.Context, repositoryID string) } taskStatus := &RepositoryDumpStatus{} - taskSteps := []taskStep{ + taskSteps := []TaskStep{ { Name: "dump commits", Func: func(ctx context.Context) error { @@ -2144,7 +2163,7 @@ func (c *Catalog) DumpRepositorySubmit(ctx context.Context, repositoryID string) // create refs dump task and update initial status. taskID := NewTaskID(DumpRefsTaskIDPrefix) - err = c.runBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus) + err = c.RunBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus) if err != nil { return "", err } @@ -2152,16 +2171,8 @@ func (c *Catalog) DumpRepositorySubmit(ctx context.Context, repositoryID string) } func (c *Catalog) DumpRepositoryStatus(ctx context.Context, repositoryID string, id string) (*RepositoryDumpStatus, error) { - repository, err := c.getRepository(ctx, repositoryID) - if err != nil { - return nil, err - } - if !IsTaskID(DumpRefsTaskIDPrefix, id) { - return nil, graveler.ErrNotFound - } - var taskStatus RepositoryDumpStatus - err = GetTaskStatus(ctx, c.KVStore, repository, id, &taskStatus) + err := c.GetValidatedTaskStatus(ctx, repositoryID, id, DumpRefsTaskIDPrefix, &taskStatus) if err != nil { return nil, err } @@ -2185,7 +2196,7 @@ func (c *Catalog) RestoreRepositorySubmit(ctx context.Context, repositoryID stri // create refs restore task and update initial status taskStatus := &RepositoryRestoreStatus{} - taskSteps := []taskStep{ + taskSteps := []TaskStep{ { Name: "load commits", Func: func(ctx context.Context) error { @@ -2206,33 +2217,25 @@ func (c *Catalog) RestoreRepositorySubmit(ctx context.Context, repositoryID stri }, } taskID := NewTaskID(RestoreRefsTaskIDPrefix) - if err := c.runBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus); err != nil { + if err := c.RunBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus); err != nil { return "", err } return taskID, nil } func (c *Catalog) RestoreRepositoryStatus(ctx context.Context, repositoryID string, id string) (*RepositoryRestoreStatus, error) { - repository, err := c.getRepository(ctx, repositoryID) - if err != nil { - return nil, err - } - if !IsTaskID(RestoreRefsTaskIDPrefix, id) { - return nil, graveler.ErrNotFound - } - var status RepositoryRestoreStatus - err = GetTaskStatus(ctx, c.KVStore, repository, id, &status) + err := c.GetValidatedTaskStatus(ctx, repositoryID, id, RestoreRefsTaskIDPrefix, &status) if err != nil { return nil, err } return &status, nil } -// runBackgroundTaskSteps update task status provided after filling the 'Task' field and update for each step provided. +// RunBackgroundTaskSteps update task status provided after filling the 'Task' field and update for each step provided. // the task status is updated after each step, and the task is marked as completed if the step is the last one. // initial update if the task is done before running the steps. -func (c *Catalog) runBackgroundTaskSteps(repository *graveler.RepositoryRecord, taskID string, steps []taskStep, taskStatus protoreflect.ProtoMessage) error { +func (c *Catalog) RunBackgroundTaskSteps(repository *graveler.RepositoryRecord, taskID string, steps []TaskStep, taskStatus protoreflect.ProtoMessage) error { // Allocate Task and set if on the taskStatus's 'Task' field. // We continue to update this field while running each step. // If the task field in the common Protobuf message is changed, we need to update the field name here as well. @@ -2260,7 +2263,13 @@ func (c *Catalog) runBackgroundTaskSteps(repository *graveler.RepositoryRecord, if err != nil { log.WithError(err).WithField("step", step.Name).Errorf("Catalog background task step failed") task.Done = true - task.Error = err.Error() + // Convert the error to status code and error message before the original error is lost when stored in + // protobuf, and populate the task's error details. + statusCode, errorMsg, ok := c.errorToStatusCodeAndMsg(log, err) + if ok { + task.StatusCode = int32(statusCode) //nolint:gosec + task.ErrorMsg = errorMsg + } } else if stepIdx == len(steps)-1 { task.Done = true } @@ -2725,7 +2734,7 @@ func (c *Catalog) PrepareExpiredCommitsAsync(ctx context.Context, repositoryID s } taskStatus := &GarbageCollectionPrepareStatus{} - taskSteps := []taskStep{ + taskSteps := []TaskStep{ { Name: "prepare expired commits on " + repository.RepositoryID.String(), Func: func(ctx context.Context) error { @@ -2744,24 +2753,27 @@ func (c *Catalog) PrepareExpiredCommitsAsync(ctx context.Context, repositoryID s } taskID := NewTaskID(GarbageCollectionPrepareCommitsPrefix) - err = c.runBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus) + err = c.RunBackgroundTaskSteps(repository, taskID, taskSteps, taskStatus) if err != nil { return "", err } return taskID, nil } -func (c *Catalog) GetGarbageCollectionPrepareStatus(ctx context.Context, repositoryID string, id string) (*GarbageCollectionPrepareStatus, error) { +func (c *Catalog) GetValidatedTaskStatus(ctx context.Context, repositoryID string, taskID string, prefix string, statusMsg protoreflect.ProtoMessage) error { repository, err := c.getRepository(ctx, repositoryID) if err != nil { - return nil, err + return err } - if !IsTaskID(GarbageCollectionPrepareCommitsPrefix, id) { - return nil, graveler.ErrNotFound + if !IsTaskID(prefix, taskID) { + return graveler.ErrNotFound } + return GetTaskStatus(ctx, c.KVStore, repository, taskID, statusMsg) +} +func (c *Catalog) GetGarbageCollectionPrepareStatus(ctx context.Context, repositoryID string, id string) (*GarbageCollectionPrepareStatus, error) { var taskStatus GarbageCollectionPrepareStatus - err = GetTaskStatus(ctx, c.KVStore, repository, id, &taskStatus) + err := c.GetValidatedTaskStatus(ctx, repositoryID, id, GarbageCollectionPrepareCommitsPrefix, &taskStatus) if err != nil { return nil, err } diff --git a/pkg/catalog/catalog.pb.go b/pkg/catalog/catalog.pb.go index be329777e2e..a596eaab4fe 100644 --- a/pkg/catalog/catalog.pb.go +++ b/pkg/catalog/catalog.pb.go @@ -7,6 +7,7 @@ package catalog import ( + graveler "github.com/treeverse/lakefs/pkg/graveler" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -173,7 +174,8 @@ type Task struct { Done bool `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` Progress int64 `protobuf:"varint,4,opt,name=progress,proto3" json:"progress,omitempty"` - Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` + ErrorMsg string `protobuf:"bytes,5,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` + StatusCode int32 `protobuf:"varint,6,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -236,13 +238,20 @@ func (x *Task) GetProgress() int64 { return 0 } -func (x *Task) GetError() string { +func (x *Task) GetErrorMsg() string { if x != nil { - return x.Error + return x.ErrorMsg } return "" } +func (x *Task) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + // RepositoryDumpInfo holds the metarange IDs for a repository dump type RepositoryDumpInfo struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -517,6 +526,154 @@ func (x *GarbageCollectionPrepareStatus) GetInfo() *GarbageCollectionPrepareComm return nil } +type CommitAsyncStatusData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Info *graveler.CommitData `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommitAsyncStatusData) Reset() { + *x = CommitAsyncStatusData{} + mi := &file_catalog_catalog_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommitAsyncStatusData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitAsyncStatusData) ProtoMessage() {} + +func (x *CommitAsyncStatusData) ProtoReflect() protoreflect.Message { + mi := &file_catalog_catalog_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitAsyncStatusData.ProtoReflect.Descriptor instead. +func (*CommitAsyncStatusData) Descriptor() ([]byte, []int) { + return file_catalog_catalog_proto_rawDescGZIP(), []int{7} +} + +func (x *CommitAsyncStatusData) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *CommitAsyncStatusData) GetInfo() *graveler.CommitData { + if x != nil { + return x.Info + } + return nil +} + +type MergeData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MergeData) Reset() { + *x = MergeData{} + mi := &file_catalog_catalog_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MergeData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeData) ProtoMessage() {} + +func (x *MergeData) ProtoReflect() protoreflect.Message { + mi := &file_catalog_catalog_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeData.ProtoReflect.Descriptor instead. +func (*MergeData) Descriptor() ([]byte, []int) { + return file_catalog_catalog_proto_rawDescGZIP(), []int{8} +} + +func (x *MergeData) GetReference() string { + if x != nil { + return x.Reference + } + return "" +} + +type MergeAsyncStatusData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Info *MergeData `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MergeAsyncStatusData) Reset() { + *x = MergeAsyncStatusData{} + mi := &file_catalog_catalog_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MergeAsyncStatusData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeAsyncStatusData) ProtoMessage() {} + +func (x *MergeAsyncStatusData) ProtoReflect() protoreflect.Message { + mi := &file_catalog_catalog_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeAsyncStatusData.ProtoReflect.Descriptor instead. +func (*MergeAsyncStatusData) Descriptor() ([]byte, []int) { + return file_catalog_catalog_proto_rawDescGZIP(), []int{9} +} + +func (x *MergeAsyncStatusData) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *MergeAsyncStatusData) GetInfo() *MergeData { + if x != nil { + return x.Info + } + return nil +} + // TaskMsg described generic message with Task field // used for all status messages and for cleanup messages type TaskMsg struct { @@ -528,7 +685,7 @@ type TaskMsg struct { func (x *TaskMsg) Reset() { *x = TaskMsg{} - mi := &file_catalog_catalog_proto_msgTypes[7] + mi := &file_catalog_catalog_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -540,7 +697,7 @@ func (x *TaskMsg) String() string { func (*TaskMsg) ProtoMessage() {} func (x *TaskMsg) ProtoReflect() protoreflect.Message { - mi := &file_catalog_catalog_proto_msgTypes[7] + mi := &file_catalog_catalog_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -553,7 +710,7 @@ func (x *TaskMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskMsg.ProtoReflect.Descriptor instead. func (*TaskMsg) Descriptor() ([]byte, []int) { - return file_catalog_catalog_proto_rawDescGZIP(), []int{7} + return file_catalog_catalog_proto_rawDescGZIP(), []int{10} } func (x *TaskMsg) GetTask() *Task { @@ -567,7 +724,7 @@ var File_catalog_catalog_proto protoreflect.FileDescriptor const file_catalog_catalog_proto_rawDesc = "" + "\n" + - "\x15catalog/catalog.proto\x12\acatalog\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa5\x03\n" + + "\x15catalog/catalog.proto\x12\acatalog\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17graveler/graveler.proto\"\xa5\x03\n" + "\x05Entry\x12\x18\n" + "\aaddress\x18\x01 \x01(\tR\aaddress\x12?\n" + "\rlast_modified\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\flastModified\x12\x12\n" + @@ -582,14 +739,16 @@ const file_catalog_catalog_proto_rawDesc = "" + "\vAddressType\x12\x18\n" + "\x14BY_PREFIX_DEPRECATED\x10\x00\x12\f\n" + "\bRELATIVE\x10\x01\x12\b\n" + - "\x04FULL\x10\x02\"\x97\x01\n" + + "\x04FULL\x10\x02\"\xbf\x01\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04done\x18\x02 \x01(\bR\x04done\x129\n" + "\n" + "updated_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1a\n" + - "\bprogress\x18\x04 \x01(\x03R\bprogress\x12\x14\n" + - "\x05error\x18\x05 \x01(\tR\x05error\"\xa6\x01\n" + + "\bprogress\x18\x04 \x01(\x03R\bprogress\x12\x1b\n" + + "\terror_msg\x18\x05 \x01(\tR\berrorMsg\x12\x1f\n" + + "\vstatus_code\x18\x06 \x01(\x05R\n" + + "statusCode\"\xa6\x01\n" + "\x12RepositoryDumpInfo\x120\n" + "\x14commits_metarange_id\x18\x01 \x01(\tR\x12commitsMetarangeId\x12*\n" + "\x11tags_metarange_id\x18\x02 \x01(\tR\x0ftagsMetarangeId\x122\n" + @@ -605,7 +764,15 @@ const file_catalog_catalog_proto_rawDesc = "" + "\x15gc_addresses_location\x18\x03 \x01(\tR\x13gcAddressesLocation\"\x85\x01\n" + "\x1eGarbageCollectionPrepareStatus\x12!\n" + "\x04task\x18\x01 \x01(\v2\r.catalog.TaskR\x04task\x12@\n" + - "\x04info\x18\x02 \x01(\v2,.catalog.GarbageCollectionPrepareCommitsInfoR\x04info\",\n" + + "\x04info\x18\x02 \x01(\v2,.catalog.GarbageCollectionPrepareCommitsInfoR\x04info\"x\n" + + "\x15CommitAsyncStatusData\x12!\n" + + "\x04task\x18\x01 \x01(\v2\r.catalog.TaskR\x04task\x12<\n" + + "\x04info\x18\x02 \x01(\v2(.io.treeverse.lakefs.graveler.CommitDataR\x04info\")\n" + + "\tMergeData\x12\x1c\n" + + "\treference\x18\x01 \x01(\tR\treference\"a\n" + + "\x14MergeAsyncStatusData\x12!\n" + + "\x04task\x18\x01 \x01(\v2\r.catalog.TaskR\x04task\x12&\n" + + "\x04info\x18\x02 \x01(\v2\x12.catalog.MergeDataR\x04info\",\n" + "\aTaskMsg\x12!\n" + "\x04task\x18\x01 \x01(\v2\r.catalog.TaskR\x04taskB$Z\"github.com/treevese/lakefs/catalogb\x06proto3" @@ -622,7 +789,7 @@ func file_catalog_catalog_proto_rawDescGZIP() []byte { } var file_catalog_catalog_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_catalog_catalog_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_catalog_catalog_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_catalog_catalog_proto_goTypes = []any{ (Entry_AddressType)(0), // 0: catalog.Entry.AddressType (*Entry)(nil), // 1: catalog.Entry @@ -632,26 +799,34 @@ var file_catalog_catalog_proto_goTypes = []any{ (*RepositoryRestoreStatus)(nil), // 5: catalog.RepositoryRestoreStatus (*GarbageCollectionPrepareCommitsInfo)(nil), // 6: catalog.GarbageCollectionPrepareCommitsInfo (*GarbageCollectionPrepareStatus)(nil), // 7: catalog.GarbageCollectionPrepareStatus - (*TaskMsg)(nil), // 8: catalog.TaskMsg - nil, // 9: catalog.Entry.MetadataEntry - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (*CommitAsyncStatusData)(nil), // 8: catalog.CommitAsyncStatusData + (*MergeData)(nil), // 9: catalog.MergeData + (*MergeAsyncStatusData)(nil), // 10: catalog.MergeAsyncStatusData + (*TaskMsg)(nil), // 11: catalog.TaskMsg + nil, // 12: catalog.Entry.MetadataEntry + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*graveler.CommitData)(nil), // 14: io.treeverse.lakefs.graveler.CommitData } var file_catalog_catalog_proto_depIdxs = []int32{ - 10, // 0: catalog.Entry.last_modified:type_name -> google.protobuf.Timestamp - 9, // 1: catalog.Entry.metadata:type_name -> catalog.Entry.MetadataEntry + 13, // 0: catalog.Entry.last_modified:type_name -> google.protobuf.Timestamp + 12, // 1: catalog.Entry.metadata:type_name -> catalog.Entry.MetadataEntry 0, // 2: catalog.Entry.address_type:type_name -> catalog.Entry.AddressType - 10, // 3: catalog.Task.updated_at:type_name -> google.protobuf.Timestamp + 13, // 3: catalog.Task.updated_at:type_name -> google.protobuf.Timestamp 2, // 4: catalog.RepositoryDumpStatus.task:type_name -> catalog.Task 3, // 5: catalog.RepositoryDumpStatus.info:type_name -> catalog.RepositoryDumpInfo 2, // 6: catalog.RepositoryRestoreStatus.task:type_name -> catalog.Task 2, // 7: catalog.GarbageCollectionPrepareStatus.task:type_name -> catalog.Task 6, // 8: catalog.GarbageCollectionPrepareStatus.info:type_name -> catalog.GarbageCollectionPrepareCommitsInfo - 2, // 9: catalog.TaskMsg.task:type_name -> catalog.Task - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 2, // 9: catalog.CommitAsyncStatusData.task:type_name -> catalog.Task + 14, // 10: catalog.CommitAsyncStatusData.info:type_name -> io.treeverse.lakefs.graveler.CommitData + 2, // 11: catalog.MergeAsyncStatusData.task:type_name -> catalog.Task + 9, // 12: catalog.MergeAsyncStatusData.info:type_name -> catalog.MergeData + 2, // 13: catalog.TaskMsg.task:type_name -> catalog.Task + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_catalog_catalog_proto_init() } @@ -665,7 +840,7 @@ func file_catalog_catalog_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_catalog_catalog_proto_rawDesc), len(file_catalog_catalog_proto_rawDesc)), NumEnums: 1, - NumMessages: 9, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/catalog/catalog.proto b/pkg/catalog/catalog.proto index dffab36873a..c0b471c76ad 100644 --- a/pkg/catalog/catalog.proto +++ b/pkg/catalog/catalog.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package catalog; import "google/protobuf/timestamp.proto"; +import "graveler/graveler.proto"; option go_package = "github.com/treevese/lakefs/catalog"; @@ -30,7 +31,8 @@ message Task { bool done = 2; google.protobuf.Timestamp updated_at = 3; int64 progress = 4; - string error = 5; + string error_msg = 5; + int32 status_code = 6; } // RepositoryDumpInfo holds the metarange IDs for a repository dump @@ -65,6 +67,20 @@ message GarbageCollectionPrepareStatus { GarbageCollectionPrepareCommitsInfo info = 2; } +message CommitAsyncStatusData { + Task task = 1; + io.treeverse.lakefs.graveler.CommitData info = 2; +} + +message MergeData { + string reference = 1; +} + +message MergeAsyncStatusData { + Task task = 1; + MergeData info = 2; +} + // TaskMsg described generic message with Task field // used for all status messages and for cleanup messages message TaskMsg { diff --git a/pkg/catalog/extended_operations.go b/pkg/catalog/extended_operations.go new file mode 100644 index 00000000000..88e447ae559 --- /dev/null +++ b/pkg/catalog/extended_operations.go @@ -0,0 +1,97 @@ +package catalog + +import ( + "context" + + "github.com/treeverse/lakefs/pkg/graveler" +) + +type ExtendedOperations interface { + SubmitCommit( + ctx context.Context, + repositoryID string, + branch string, + message string, + committer string, + metadata Metadata, + date *int64, + sourceMetarange *string, + allowEmpty bool, + opts ...graveler.SetOptionsFunc, + ) (taskID string, err error) + + GetCommitStatus( + ctx context.Context, + repositoryID string, + taskID string, + ) (*CommitAsyncStatusData, error) + + SubmitMergeIntoBranch( + ctx context.Context, + repositoryID string, + destinationBranch string, + sourceRef string, + committer string, + message string, + metadata Metadata, + strategy string, + opts ...graveler.SetOptionsFunc, + ) (taskID string, err error) + + GetMergeIntoBranchStatus( + ctx context.Context, + repositoryID string, + taskID string, + ) (*MergeAsyncStatusData, error) +} + +type NoopExtendedOperations struct{} + +func NewNoopExtendedOperations() *NoopExtendedOperations { + return &NoopExtendedOperations{} +} + +func (h *NoopExtendedOperations) SubmitCommit( + ctx context.Context, + repositoryID string, + branch string, + message string, + committer string, + metadata Metadata, + date *int64, + sourceMetarange *string, + allowEmpty bool, + opts ...graveler.SetOptionsFunc, +) (string, error) { + return "", ErrNotImplemented +} + +func (h *NoopExtendedOperations) GetCommitStatus( + ctx context.Context, + repositoryID string, + taskID string, +) (*CommitAsyncStatusData, error) { + return nil, ErrNotImplemented +} + +func (h *NoopExtendedOperations) SubmitMergeIntoBranch( + ctx context.Context, + repositoryID string, + destinationBranch string, + sourceRef string, + committer string, + message string, + metadata Metadata, + strategy string, + opts ...graveler.SetOptionsFunc, +) (string, error) { + return "", ErrNotImplemented +} + +func (h *NoopExtendedOperations) GetMergeIntoBranchStatus( + ctx context.Context, + repositoryID string, + taskID string, +) (*MergeAsyncStatusData, error) { + return nil, ErrNotImplemented +} diff --git a/pkg/catalog/task.go b/pkg/catalog/task.go index 78efec99c48..bdcb2a7cd15 100644 --- a/pkg/catalog/task.go +++ b/pkg/catalog/task.go @@ -16,7 +16,7 @@ const ( tasksPrefix = "tasks" ) -type taskStep struct { +type TaskStep struct { Name string Func func(ctx context.Context) error } diff --git a/pkg/graveler/graveler.pb.go b/pkg/graveler/graveler.pb.go index 3cb3c716c58..a55cb08373f 100644 --- a/pkg/graveler/graveler.pb.go +++ b/pkg/graveler/graveler.pb.go @@ -1103,7 +1103,7 @@ const file_graveler_graveler_proto_rawDesc = "" + "\n" + "\x06CLOSED\x10\x01\x12\n" + "\n" + - "\x06MERGED\x10\x02B&Z$github.com/treeverse/lakefs/gravelerb\x06proto3" + "\x06MERGED\x10\x02B*Z(github.com/treeverse/lakefs/pkg/gravelerb\x06proto3" var ( file_graveler_graveler_proto_rawDescOnce sync.Once diff --git a/pkg/graveler/graveler.proto b/pkg/graveler/graveler.proto index 54cfbaaf35a..32f8a076577 100644 --- a/pkg/graveler/graveler.proto +++ b/pkg/graveler/graveler.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/treeverse/lakefs/graveler"; +option go_package = "github.com/treeverse/lakefs/pkg/graveler"; import "google/protobuf/timestamp.proto"; diff --git a/pkg/httputil/request.go b/pkg/httputil/request.go index 1f1cf70f566..86dd1e95a3d 100644 --- a/pkg/httputil/request.go +++ b/pkg/httputil/request.go @@ -7,5 +7,8 @@ import ( ) func IsRequestCanceled(r *http.Request) bool { + if r == nil { + return false + } return errors.Is(r.Context().Err(), context.Canceled) } diff --git a/pkg/loadtest/local_load_test.go b/pkg/loadtest/local_load_test.go index d086dd4618c..dc2b31b577f 100644 --- a/pkg/loadtest/local_load_test.go +++ b/pkg/loadtest/local_load_test.go @@ -108,6 +108,7 @@ func TestLocalLoad(t *testing.T) { migrator, &stats.NullCollector{}, actionsService, + catalog.NewNoopExtendedOperations(), auditChecker, logging.ContextUnavailable(), nil,