|
| 1 | +/** |
| 2 | + * -------------------------------------------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose Pty Ltd" file="ConvertDocumentDirectRequest.java"> |
| 4 | + * Copyright (c) 2003-2018 Aspose Pty Ltd |
| 5 | + * </copyright> |
| 6 | + * <summary> |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + * </summary> |
| 25 | + * -------------------------------------------------------------------------------------------------------------------- |
| 26 | + */ |
| 27 | + |
| 28 | +package com.groupdocs.cloud.conversion.model.requests; |
| 29 | + |
| 30 | +import java.util.Objects; |
| 31 | +import com.google.gson.TypeAdapter; |
| 32 | +import com.google.gson.annotations.JsonAdapter; |
| 33 | +import com.google.gson.annotations.SerializedName; |
| 34 | +import com.google.gson.stream.JsonReader; |
| 35 | +import com.google.gson.stream.JsonWriter; |
| 36 | +import com.groupdocs.cloud.conversion.model.*; |
| 37 | +import io.swagger.annotations.ApiModel; |
| 38 | +import io.swagger.annotations.ApiModelProperty; |
| 39 | +import java.io.IOException; |
| 40 | +import java.io.File; |
| 41 | + |
| 42 | +/** |
| 43 | + * Request model for convertDocumentDirect method. |
| 44 | + */ |
| 45 | +public class ConvertDocumentDirectRequest { |
| 46 | + |
| 47 | + /** |
| 48 | + * Initializes a new instance of the ConvertDocumentDirectRequest class. |
| 49 | + */ |
| 50 | + public ConvertDocumentDirectRequest() |
| 51 | + { |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * Initializes a new instance of the ConvertDocumentDirectRequest class. |
| 56 | + * @param format Requested conversion format |
| 57 | + * @param file Input file to convert |
| 58 | + * @param fromPage Page start conversion from |
| 59 | + * @param pagesCount Number of pages to convert |
| 60 | + */ |
| 61 | + public ConvertDocumentDirectRequest(String format, File file, Integer fromPage, Integer pagesCount) |
| 62 | + { |
| 63 | + this.format = format; |
| 64 | + this.file = file; |
| 65 | + this.fromPage = fromPage; |
| 66 | + this.pagesCount = pagesCount; |
| 67 | + } |
| 68 | + |
| 69 | + @SerializedName("format") |
| 70 | + private String format = null; |
| 71 | + |
| 72 | + @SerializedName("file") |
| 73 | + private File file = null; |
| 74 | + |
| 75 | + @SerializedName("fromPage") |
| 76 | + private Integer fromPage = null; |
| 77 | + |
| 78 | + @SerializedName("pagesCount") |
| 79 | + private Integer pagesCount = null; |
| 80 | + |
| 81 | + /** |
| 82 | + * Requested conversion format |
| 83 | + * @return Requested conversion format |
| 84 | + **/ |
| 85 | + @ApiModelProperty(example = "format_example", required = true, value = "Requested conversion format") |
| 86 | + public String getformat() { |
| 87 | + return format; |
| 88 | + } |
| 89 | + |
| 90 | + public void setformat(String format) { |
| 91 | + this.format = format; |
| 92 | + } |
| 93 | + |
| 94 | + /** |
| 95 | + * Input file to convert |
| 96 | + * @return Input file to convert |
| 97 | + **/ |
| 98 | + @ApiModelProperty(example = "new File("/path/to/file.txt")", required = true, value = "Input file to convert") |
| 99 | + public File getFile() { |
| 100 | + return file; |
| 101 | + } |
| 102 | + |
| 103 | + public void setFile(File file) { |
| 104 | + this.file = file; |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Page start conversion from |
| 109 | + * @return Page start conversion from |
| 110 | + **/ |
| 111 | + @ApiModelProperty(example = "1", value = "Page start conversion from") |
| 112 | + public Integer getfromPage() { |
| 113 | + return fromPage; |
| 114 | + } |
| 115 | + |
| 116 | + public void setfromPage(Integer fromPage) { |
| 117 | + this.fromPage = fromPage; |
| 118 | + } |
| 119 | + |
| 120 | + /** |
| 121 | + * Number of pages to convert |
| 122 | + * @return Number of pages to convert |
| 123 | + **/ |
| 124 | + @ApiModelProperty(example = "0", value = "Number of pages to convert") |
| 125 | + public Integer getpagesCount() { |
| 126 | + return pagesCount; |
| 127 | + } |
| 128 | + |
| 129 | + public void setpagesCount(Integer pagesCount) { |
| 130 | + this.pagesCount = pagesCount; |
| 131 | + } |
| 132 | + |
| 133 | + @Override |
| 134 | + public boolean equals(java.lang.Object o) { |
| 135 | + if (this == o) { |
| 136 | + return true; |
| 137 | + } |
| 138 | + |
| 139 | + if (o == null || getClass() != o.getClass()) { |
| 140 | + return false; |
| 141 | + } |
| 142 | + |
| 143 | + ConvertDocumentDirectRequest request = (ConvertDocumentDirectRequest) o; |
| 144 | + return Objects.equals(this.format, request.format) && |
| 145 | + Objects.equals(this.file, request.file) && |
| 146 | + Objects.equals(this.fromPage, request.fromPage) && |
| 147 | + Objects.equals(this.pagesCount, request.pagesCount); |
| 148 | + } |
| 149 | + |
| 150 | + @Override |
| 151 | + public int hashCode() { |
| 152 | + return Objects.hash(format, file, fromPage, pagesCount); |
| 153 | + } |
| 154 | + |
| 155 | + @Override |
| 156 | + public String toString() { |
| 157 | + StringBuilder sb = new StringBuilder(); |
| 158 | + sb.append("class ConvertDocumentDirect {\n"); |
| 159 | + sb.append(" format: ").append(toIndentedString(format)).append("\n"); |
| 160 | + sb.append(" file: ").append(toIndentedString(file)).append("\n"); |
| 161 | + sb.append(" fromPage: ").append(toIndentedString(fromPage)).append("\n"); |
| 162 | + sb.append(" pagesCount: ").append(toIndentedString(pagesCount)).append("\n"); |
| 163 | + sb.append("}"); |
| 164 | + return sb.toString(); |
| 165 | + } |
| 166 | + |
| 167 | + /** |
| 168 | + * Convert the given object to string with each line indented by 4 spaces |
| 169 | + * (except the first line). |
| 170 | + */ |
| 171 | + private String toIndentedString(java.lang.Object o) { |
| 172 | + if (o == null) { |
| 173 | + return "null"; |
| 174 | + } |
| 175 | + return o.toString().replace("\n", "\n "); |
| 176 | + } |
| 177 | +} |
| 178 | + |
0 commit comments