Class ChangeFileOperation

java.lang.Object
build.cursed.genapi.forgejo.model.ChangeFileOperation

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2026-09-28T16:24:31.414706+02:00[Europe/Stockholm]", comments="Generator version: 7.21.0") public class ChangeFileOperation extends Object
ChangeFileOperation for creating, updating or deleting a file
  • Field Details

  • Constructor Details

    • ChangeFileOperation

      public ChangeFileOperation()
  • Method Details

    • content

      public ChangeFileOperation content(@Nullable String content)
    • getContent

      @Nullable public String getContent()
      new or updated file content, must be base64 encoded
      Returns:
      content
    • setContent

      public void setContent(@Nullable String content)
    • fromPath

      public ChangeFileOperation fromPath(@Nullable String fromPath)
    • getFromPath

      @Nullable public String getFromPath()
      old path of the file to move
      Returns:
      fromPath
    • setFromPath

      public void setFromPath(@Nullable String fromPath)
    • operation

      public ChangeFileOperation operation(@Nonnull ChangeFileOperation.OperationEnum operation)
    • getOperation

      @Nonnull public ChangeFileOperation.OperationEnum getOperation()
      indicates what to do with the file
      Returns:
      operation
    • setOperation

      public void setOperation(@Nonnull ChangeFileOperation.OperationEnum operation)
    • path

      public ChangeFileOperation path(@Nonnull String path)
    • getPath

      @Nonnull public String getPath()
      path to the existing or new file
      Returns:
      path
    • setPath

      public void setPath(@Nonnull String path)
    • sha

      public ChangeFileOperation sha(@Nullable String sha)
    • getSha

      @Nullable public String getSha()
      sha is the SHA for the file that already exists, required for update or delete
      Returns:
      sha
    • setSha

      public void setSha(@Nullable String sha)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to ChangeFileOperation
    • fromJson

      public static ChangeFileOperation fromJson(String jsonString) throws IOException
      Create an instance of ChangeFileOperation given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of ChangeFileOperation
      Throws:
      IOException - if the JSON string is invalid with respect to ChangeFileOperation
    • toJson

      public String toJson()
      Convert an instance of ChangeFileOperation to an JSON string
      Returns:
      JSON string