diff --git a/docs/ChangeFileOperation.md b/docs/ChangeFileOperation.md index 05b133a..89a8e97 100644 --- a/docs/ChangeFileOperation.md +++ b/docs/ChangeFileOperation.md @@ -3,11 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **String** | content must be base64 encoded | +**content** | **String** | new or updated file content, must be base64 encoded | [optional] **fromPath** | **String** | old path of the file to move | [optional] **operation** | [**OperationEnum**](#OperationEnum) | indicates what to do with the file | -**path** | **String** | path to the existing or new file | [optional] -**sha** | **String** | sha is the SHA for the file that already exists, required for update, delete | [optional] +**path** | **String** | path to the existing or new file | +**sha** | **String** | sha is the SHA for the file that already exists, required for update or delete | [optional] ## Enum: OperationEnum diff --git a/docs/ChangeFilesOptions.md b/docs/ChangeFilesOptions.md index 3bfd5fe..c2b49d8 100644 --- a/docs/ChangeFilesOptions.md +++ b/docs/ChangeFilesOptions.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **branch** | **String** | branch (optional) to base this file from. if not given, the default branch is used | [optional] **committer** | [**Identity**](Identity.md) | | [optional] **dates** | [**CommitDateOptions**](CommitDateOptions.md) | | [optional] -**files** | [**List<ChangeFileOperation>**](ChangeFileOperation.md) | | [optional] +**files** | [**List<ChangeFileOperation>**](ChangeFileOperation.md) | list of file operations | **message** | **String** | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] **newBranch** | **String** | new_branch (optional) will make a new branch from `branch` before creating the 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/docs/RepositoryApi.md b/docs/RepositoryApi.md index 360b803..f62b198 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -19,7 +19,7 @@ Method | HTTP request | Description [**repoAddTopic**](RepositoryApi.md#repoAddTopic) | **PUT** repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository [**repoApplyDiffPatch**](RepositoryApi.md#repoApplyDiffPatch) | **POST** repos/{owner}/{repo}/diffpatch | Apply diff patch to repository [**repoCancelScheduledAutoMerge**](RepositoryApi.md#repoCancelScheduledAutoMerge) | **DELETE** repos/{owner}/{repo}/pulls/{index}/merge | Cancel the scheduled auto merge for the given pull request -[**repoChangeFiles**](RepositoryApi.md#repoChangeFiles) | **POST** repos/{owner}/{repo}/contents | Create or update multiple files in a repository +[**repoChangeFiles**](RepositoryApi.md#repoChangeFiles) | **POST** repos/{owner}/{repo}/contents | Modify multiple files in a repository [**repoCheckCollaborator**](RepositoryApi.md#repoCheckCollaborator) | **GET** repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository [**repoCheckTeam**](RepositoryApi.md#repoCheckTeam) | **GET** repos/{owner}/{repo}/teams/{team} | Check if a team is assigned to a repository [**repoCreateBranch**](RepositoryApi.md#repoCreateBranch) | **POST** repos/{owner}/{repo}/branches | Create a branch @@ -1518,7 +1518,7 @@ Name | Type | Description | Notes # **repoChangeFiles** > FilesResponse repoChangeFiles(body, owner, repo) -Create or update multiple files in a repository +Modify multiple files in a repository ### Example ```java 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 0237063..6a30220 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -303,7 +303,7 @@ public interface RepositoryApi { @retrofit2.http.Path("index") Long index); /** - * Create or update multiple files in a repository + * Modify multiple files in a repository * * @param body (required) * @param owner owner of the repo (required) diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ChangeFileOperation.java b/src/main/java/org/gitnex/tea4j/v2/models/ChangeFileOperation.java index eb33b62..7ea20d8 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/ChangeFileOperation.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/ChangeFileOperation.java @@ -94,11 +94,11 @@ public class ChangeFileOperation implements Serializable { } /** - * content must be base64 encoded + * new or updated file content, must be base64 encoded * * @return content */ - @Schema(required = true, description = "content must be base64 encoded") + @Schema(description = "new or updated file content, must be base64 encoded") public String getContent() { return content; } @@ -155,7 +155,7 @@ public class ChangeFileOperation implements Serializable { * * @return path */ - @Schema(description = "path to the existing or new file") + @Schema(required = true, description = "path to the existing or new file") public String getPath() { return path; } @@ -170,12 +170,13 @@ public class ChangeFileOperation implements Serializable { } /** - * sha is the SHA for the file that already exists, required for update, delete + * sha is the SHA for the file that already exists, required for update or delete * * @return sha */ @Schema( - description = "sha is the SHA for the file that already exists, required for update, delete") + description = + "sha is the SHA for the file that already exists, required for update or delete") public String getSha() { return sha; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ChangeFilesOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/ChangeFilesOptions.java index b3ab23c..7847998 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/ChangeFilesOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/ChangeFilesOptions.java @@ -45,7 +45,7 @@ public class ChangeFilesOptions implements Serializable { private CommitDateOptions dates = null; @SerializedName("files") - private List files = null; + private List files = new ArrayList<>(); @SerializedName("message") private String message = null; @@ -140,19 +140,16 @@ public class ChangeFilesOptions implements Serializable { } public ChangeFilesOptions addFilesItem(ChangeFileOperation filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } this.files.add(filesItem); return this; } /** - * Get files + * list of file operations * * @return files */ - @Schema(description = "") + @Schema(required = true, description = "list of file operations") public List getFiles() { return files; }