From e7078b8844c322945633210c3d40ef119c3ba07a Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Sat, 25 Oct 2025 00:09:58 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/DeleteFileOptions.md | 2 +- docs/RepositoryApi.md | 4 ++-- docs/UpdateFileOptions.md | 2 +- .../gitnex/tea4j/v2/apis/RepositoryApi.java | 2 +- .../tea4j/v2/models/CreateFileOptions.java | 4 ++-- .../tea4j/v2/models/DeleteFileOptions.java | 20 ++++++++----------- .../tea4j/v2/models/UpdateFileOptions.java | 20 +++++++++---------- 7 files changed, 25 insertions(+), 29 deletions(-) diff --git a/docs/DeleteFileOptions.md b/docs/DeleteFileOptions.md index d0614d7..17e09f9 100644 --- a/docs/DeleteFileOptions.md +++ b/docs/DeleteFileOptions.md @@ -10,5 +10,5 @@ Name | Type | Description | Notes **forcePush** | **Boolean** | force_push (optional) will do a force-push if the new branch already exists | [optional] **message** | **String** | message (optional) is the commit message of the changes. If not supplied, a default message will be used | [optional] **newBranch** | **String** | new_branch (optional) will make a new branch from base branch for the changes. If not supplied, the changes will be committed to the base branch | [optional] -**sha** | **String** | the blob ID (SHA) for the file that already exists, it is required for changing existing files | +**sha** | **String** | the blob ID (SHA) for the file to delete | **signoff** | **Boolean** | Add a Signed-off-by trailer by the committer at the end of the commit log message. | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index 1f94b92..d1209dc 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -184,7 +184,7 @@ Method | HTTP request | Description [**repoUnDismissPullReview**](RepositoryApi.md#repoUnDismissPullReview) | **POST** repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals | Cancel to dismiss a review for a pull request [**repoUpdateAvatar**](RepositoryApi.md#repoUpdateAvatar) | **POST** repos/{owner}/{repo}/avatar | Update avatar [**repoUpdateBranchProtectionPriories**](RepositoryApi.md#repoUpdateBranchProtectionPriories) | **POST** repos/{owner}/{repo}/branch_protections/priority | Update the priorities of branch protections for a repository. -[**repoUpdateFile**](RepositoryApi.md#repoUpdateFile) | **PUT** repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository +[**repoUpdateFile**](RepositoryApi.md#repoUpdateFile) | **PUT** repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository if SHA is set, or create the file if SHA is not set [**repoUpdatePullRequest**](RepositoryApi.md#repoUpdatePullRequest) | **POST** repos/{owner}/{repo}/pulls/{index}/update | Merge PR's baseBranch into headBranch [**repoUpdateTopics**](RepositoryApi.md#repoUpdateTopics) | **PUT** repos/{owner}/{repo}/topics | Replace list of topics for a repository [**repoValidateIssueConfig**](RepositoryApi.md#repoValidateIssueConfig) | **GET** repos/{owner}/{repo}/issue_config/validate | Returns the validation information for a issue config @@ -16899,7 +16899,7 @@ Name | Type | Description | Notes # **repoUpdateFile** > FileResponse repoUpdateFile(body, owner, repo, filepath) -Update a file in a repository +Update a file in a repository if SHA is set, or create the file if SHA is not set ### Example ```java diff --git a/docs/UpdateFileOptions.md b/docs/UpdateFileOptions.md index a672447..2d90717 100644 --- a/docs/UpdateFileOptions.md +++ b/docs/UpdateFileOptions.md @@ -12,5 +12,5 @@ Name | Type | Description | Notes **fromPath** | **String** | from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL | [optional] **message** | **String** | message (optional) is the commit message of the changes. If not supplied, a default message will be used | [optional] **newBranch** | **String** | new_branch (optional) will make a new branch from base branch for the changes. If not supplied, the changes will be committed to the base branch | [optional] -**sha** | **String** | the blob ID (SHA) for the file that already exists, it is required for changing existing files | +**sha** | **String** | the blob ID (SHA) for the file that already exists to update, or leave it empty to create a new file | [optional] **signoff** | **Boolean** | Add a Signed-off-by trailer by the committer at the end of the commit log message. | [optional] diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java index 52880be..f117999 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -2946,7 +2946,7 @@ public interface RepositoryApi { @retrofit2.http.Body UpdateBranchProtectionPriories body); /** - * Update a file in a repository + * Update a file in a repository if SHA is set, or create the file if SHA is not set * * @param body (required) * @param owner owner of the repo (required) diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateFileOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateFileOptions.java index 505dc97..e621ab8 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/CreateFileOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateFileOptions.java @@ -18,13 +18,13 @@ import java.io.Serializable; import java.util.Objects; /** - * CreateFileOptions options for creating files Note: `author` and `committer` + * CreateFileOptions options for creating a file Note: `author` and `committer` * are optional (if only one is given, it will be used for the other, otherwise the authenticated * user will be used) */ @Schema( description = - "CreateFileOptions options for creating files Note: `author` and `committer` are optional" + "CreateFileOptions options for creating a file Note: `author` and `committer` are optional" + " (if only one is given, it will be used for the other, otherwise the authenticated" + " user will be used)") public class CreateFileOptions implements Serializable { diff --git a/src/main/java/org/gitnex/tea4j/v2/models/DeleteFileOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/DeleteFileOptions.java index a85d911..3c25171 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/DeleteFileOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/DeleteFileOptions.java @@ -18,15 +18,15 @@ import java.io.Serializable; import java.util.Objects; /** - * DeleteFileOptions options for deleting files (used for other File structs below) Note: - * `author` and `committer` are optional (if only one is given, it will be used - * for the other, otherwise the authenticated user will be used) + * DeleteFileOptions options for deleting a file Note: `author` and `committer` + * are optional (if only one is given, it will be used for the other, otherwise the authenticated + * user will be used) */ @Schema( description = - "DeleteFileOptions options for deleting files (used for other File structs below) Note:" - + " `author` and `committer` are optional (if only one is given, it will be used for" - + " the other, otherwise the authenticated user will be used)") + "DeleteFileOptions options for deleting a file Note: `author` and `committer` are optional" + + " (if only one is given, it will be used for the other, otherwise the authenticated" + + " user will be used)") public class DeleteFileOptions implements Serializable { private static final long serialVersionUID = 1L; @@ -209,15 +209,11 @@ public class DeleteFileOptions implements Serializable { } /** - * the blob ID (SHA) for the file that already exists, it is required for changing existing files + * the blob ID (SHA) for the file to delete * * @return sha */ - @Schema( - required = true, - description = - "the blob ID (SHA) for the file that already exists, it is required for changing existing" - + " files") + @Schema(required = true, description = "the blob ID (SHA) for the file to delete") public String getSha() { return sha; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/UpdateFileOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/UpdateFileOptions.java index 15ce706..31fc07c 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/UpdateFileOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/UpdateFileOptions.java @@ -18,15 +18,15 @@ import java.io.Serializable; import java.util.Objects; /** - * UpdateFileOptions options for updating files Note: `author` and `committer` - * are optional (if only one is given, it will be used for the other, otherwise the authenticated - * user will be used) + * UpdateFileOptions options for updating or creating a file Note: `author` and + * `committer` are optional (if only one is given, it will be used for the other, + * otherwise the authenticated user will be used) */ @Schema( description = - "UpdateFileOptions options for updating files Note: `author` and `committer` are optional" - + " (if only one is given, it will be used for the other, otherwise the authenticated" - + " user will be used)") + "UpdateFileOptions options for updating or creating a file Note: `author` and `committer`" + + " are optional (if only one is given, it will be used for the other, otherwise the" + + " authenticated user will be used)") public class UpdateFileOptions implements Serializable { private static final long serialVersionUID = 1L; @@ -257,15 +257,15 @@ public class UpdateFileOptions implements Serializable { } /** - * the blob ID (SHA) for the file that already exists, it is required for changing existing files + * the blob ID (SHA) for the file that already exists to update, or leave it empty to create a new + * file * * @return sha */ @Schema( - required = true, description = - "the blob ID (SHA) for the file that already exists, it is required for changing existing" - + " files") + "the blob ID (SHA) for the file that already exists to update, or leave it empty to" + + " create a new file") public String getSha() { return sha; }