|
| 1 | +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +/* |
| 5 | + * Ark Messages API |
| 6 | + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 7 | + * |
| 8 | + * The version of the OpenAPI document: 0.1.0 |
| 9 | + * |
| 10 | + * |
| 11 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 12 | + * https://openapi-generator.tech |
| 13 | + * Do not edit the class manually. |
| 14 | + */ |
| 15 | + |
| 16 | + |
| 17 | +package com.volcengine.ark.runtime.models.messages; |
| 18 | + |
| 19 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 20 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 21 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 22 | +import java.util.Objects; |
| 23 | + |
| 24 | +/** |
| 25 | + * ContentBlockStart |
| 26 | + */ |
| 27 | +@JsonPropertyOrder({ |
| 28 | + ContentBlockStart.JSON_PROPERTY_TYPE, |
| 29 | + ContentBlockStart.JSON_PROPERTY_INDEX, |
| 30 | + ContentBlockStart.JSON_PROPERTY_CONTENT_BLOCK |
| 31 | +}) |
| 32 | +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") |
| 33 | +public class ContentBlockStart implements MessagesStreamEvent { |
| 34 | + public static final String JSON_PROPERTY_TYPE = "type"; |
| 35 | + @javax.annotation.Nonnull |
| 36 | + private MessagesStreamEventType type = MessagesStreamEventType.CONTENT_BLOCK_START; |
| 37 | + |
| 38 | + public static final String JSON_PROPERTY_INDEX = "index"; |
| 39 | + @javax.annotation.Nonnull |
| 40 | + private Integer index; |
| 41 | + |
| 42 | + public static final String JSON_PROPERTY_CONTENT_BLOCK = "content_block"; |
| 43 | + @javax.annotation.Nonnull |
| 44 | + private ContentBlockStartContentBlock contentBlock; |
| 45 | + |
| 46 | + public ContentBlockStart() { |
| 47 | + } |
| 48 | + |
| 49 | + public ContentBlockStart type(@javax.annotation.Nonnull MessagesStreamEventType type) { |
| 50 | + |
| 51 | + this.type = type; |
| 52 | + return this; |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * Get type |
| 57 | + * @return type |
| 58 | + */ |
| 59 | + @javax.annotation.Nonnull |
| 60 | + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) |
| 61 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 62 | + |
| 63 | + public MessagesStreamEventType getType() { |
| 64 | + return type; |
| 65 | + } |
| 66 | + |
| 67 | + |
| 68 | + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) |
| 69 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 70 | + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { |
| 71 | + this.type = type; |
| 72 | + } |
| 73 | + |
| 74 | + public ContentBlockStart index(@javax.annotation.Nonnull Integer index) { |
| 75 | + |
| 76 | + this.index = index; |
| 77 | + return this; |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * Get index |
| 82 | + * @return index |
| 83 | + */ |
| 84 | + @javax.annotation.Nonnull |
| 85 | + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) |
| 86 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 87 | + |
| 88 | + public Integer getIndex() { |
| 89 | + return index; |
| 90 | + } |
| 91 | + |
| 92 | + |
| 93 | + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) |
| 94 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 95 | + public void setIndex(@javax.annotation.Nonnull Integer index) { |
| 96 | + this.index = index; |
| 97 | + } |
| 98 | + |
| 99 | + public ContentBlockStart contentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) { |
| 100 | + |
| 101 | + this.contentBlock = contentBlock; |
| 102 | + return this; |
| 103 | + } |
| 104 | + |
| 105 | + /** |
| 106 | + * Get contentBlock |
| 107 | + * @return contentBlock |
| 108 | + */ |
| 109 | + @javax.annotation.Nonnull |
| 110 | + @JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true) |
| 111 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 112 | + |
| 113 | + public ContentBlockStartContentBlock getContentBlock() { |
| 114 | + return contentBlock; |
| 115 | + } |
| 116 | + |
| 117 | + |
| 118 | + @JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true) |
| 119 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 120 | + public void setContentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) { |
| 121 | + this.contentBlock = contentBlock; |
| 122 | + } |
| 123 | + |
| 124 | + |
| 125 | + @Override |
| 126 | + public boolean equals(Object o) { |
| 127 | + if (this == o) { |
| 128 | + return true; |
| 129 | + } |
| 130 | + if (o == null || getClass() != o.getClass()) { |
| 131 | + return false; |
| 132 | + } |
| 133 | + ContentBlockStart contentBlockStart = (ContentBlockStart) o; |
| 134 | + return Objects.equals(this.type, contentBlockStart.type) && |
| 135 | + Objects.equals(this.index, contentBlockStart.index) && |
| 136 | + Objects.equals(this.contentBlock, contentBlockStart.contentBlock); |
| 137 | + } |
| 138 | + |
| 139 | + @Override |
| 140 | + public int hashCode() { |
| 141 | + return Objects.hash(type, index, contentBlock); |
| 142 | + } |
| 143 | + |
| 144 | + @Override |
| 145 | + public String toString() { |
| 146 | + StringBuilder sb = new StringBuilder(); |
| 147 | + sb.append("class ContentBlockStart {\n"); |
| 148 | + sb.append(" type: ").append(toIndentedString(type)).append("\n"); |
| 149 | + sb.append(" index: ").append(toIndentedString(index)).append("\n"); |
| 150 | + sb.append(" contentBlock: ").append(toIndentedString(contentBlock)).append("\n"); |
| 151 | + sb.append("}"); |
| 152 | + return sb.toString(); |
| 153 | + } |
| 154 | + |
| 155 | + /** |
| 156 | + * Convert the given object to string with each line indented by 4 spaces |
| 157 | + * (except the first line). |
| 158 | + */ |
| 159 | + private String toIndentedString(Object o) { |
| 160 | + return o == null ? "null" : o.toString().replace("\n", "\n "); |
| 161 | + } |
| 162 | + |
| 163 | + public static class Builder { |
| 164 | + |
| 165 | + private ContentBlockStart instance; |
| 166 | + |
| 167 | + public Builder() { |
| 168 | + this(new ContentBlockStart()); |
| 169 | + } |
| 170 | + |
| 171 | + protected Builder(ContentBlockStart instance) { |
| 172 | + this.instance = instance; |
| 173 | + } |
| 174 | + |
| 175 | + public ContentBlockStart.Builder type(MessagesStreamEventType type) { |
| 176 | + this.instance.type = type; |
| 177 | + return this; |
| 178 | + } |
| 179 | + public ContentBlockStart.Builder index(Integer index) { |
| 180 | + this.instance.index = index; |
| 181 | + return this; |
| 182 | + } |
| 183 | + public ContentBlockStart.Builder contentBlock(ContentBlockStartContentBlock contentBlock) { |
| 184 | + this.instance.contentBlock = contentBlock; |
| 185 | + return this; |
| 186 | + } |
| 187 | + |
| 188 | + |
| 189 | + /** |
| 190 | + * returns a built ContentBlockStart instance. |
| 191 | + * |
| 192 | + * The builder is not reusable. |
| 193 | + */ |
| 194 | + public ContentBlockStart build() { |
| 195 | + try { |
| 196 | + return this.instance; |
| 197 | + } finally { |
| 198 | + // ensure that this.instance is not reused |
| 199 | + this.instance = null; |
| 200 | + } |
| 201 | + } |
| 202 | + |
| 203 | + @Override |
| 204 | + public String toString() { |
| 205 | + return getClass() + "=(" + instance + ")"; |
| 206 | + } |
| 207 | + } |
| 208 | + |
| 209 | + /** |
| 210 | + * Create a builder with no initialized field. |
| 211 | + */ |
| 212 | + public static ContentBlockStart.Builder builder() { |
| 213 | + return new ContentBlockStart.Builder(); |
| 214 | + } |
| 215 | + |
| 216 | + /** |
| 217 | + * Create a builder with a shallow copy of this instance. |
| 218 | + */ |
| 219 | + public ContentBlockStart.Builder toBuilder() { |
| 220 | + return new ContentBlockStart.Builder() |
| 221 | + .type(getType()) |
| 222 | + .index(getIndex()) |
| 223 | + .contentBlock(getContentBlock()); |
| 224 | + } |
| 225 | + |
| 226 | + |
| 227 | +} |
0 commit comments