|
| 1 | +import "@typespec/openapi"; |
| 2 | +import "@typespec/http"; |
| 3 | +using TypeSpec.OpenAPI; |
| 4 | +using TypeSpec.Http; |
| 5 | +namespace OpenAI; |
| 6 | +#suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 7 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 8 | +model `Error-2` { |
| 9 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 10 | + code: string; |
| 11 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 12 | + message: string; |
| 13 | +} |
| 14 | + |
| 15 | +/** Structured information describing a generated video job. */ |
| 16 | +@summary("Video job") |
| 17 | +model VideoResource { |
| 18 | + /** Unique identifier for the video job. */ |
| 19 | + id: string; |
| 20 | + |
| 21 | + /** The object type, which is always `video`. */ |
| 22 | + #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import." |
| 23 | + @extension("x-stainless-const", true) |
| 24 | + object: "video" = "video"; |
| 25 | + |
| 26 | + /** The video generation model that produced the job. */ |
| 27 | + `model`: VideoModel; |
| 28 | + |
| 29 | + /** Current lifecycle status of the video job. */ |
| 30 | + status: VideoStatus; |
| 31 | + |
| 32 | + /** Approximate completion percentage for the generation task. */ |
| 33 | + #suppress "@azure-tools/typespec-azure-core/no-generic-numeric" "Auto-suppressed warnings non-applicable rules during import." |
| 34 | + progress: integer; |
| 35 | + |
| 36 | + /** Unix timestamp (seconds) for when the job was created. */ |
| 37 | + #suppress "@azure-tools/typespec-azure-core/no-generic-numeric" "Auto-suppressed warnings non-applicable rules during import." |
| 38 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 39 | + created_at: integer; |
| 40 | + |
| 41 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 42 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 43 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 44 | + completed_at: integer | null; |
| 45 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 46 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 47 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 48 | + expires_at: integer | null; |
| 49 | + |
| 50 | + /** The resolution of the generated video. */ |
| 51 | + size: VideoSize; |
| 52 | + |
| 53 | + /** Duration of the generated clip in seconds. */ |
| 54 | + seconds: VideoSeconds; |
| 55 | + |
| 56 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 57 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 58 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 59 | + remixed_from_video_id: string | null; |
| 60 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 61 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 62 | + error: `Error-2` | null; |
| 63 | +} |
| 64 | + |
| 65 | +#suppress "@azure-tools/typespec-azure-core/no-enum" "Auto-suppressed warnings non-applicable rules during import." |
| 66 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 67 | +enum VideoModel { |
| 68 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 69 | + `sora-2`, |
| 70 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 71 | + `sora-2-pro`, |
| 72 | +} |
| 73 | + |
| 74 | +#suppress "@azure-tools/typespec-azure-core/no-enum" "Auto-suppressed warnings non-applicable rules during import." |
| 75 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 76 | +enum VideoStatus { |
| 77 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 78 | + queued, |
| 79 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 80 | + in_progress, |
| 81 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 82 | + completed, |
| 83 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 84 | + failed, |
| 85 | +} |
| 86 | + |
| 87 | +#suppress "@azure-tools/typespec-azure-core/no-enum" "Auto-suppressed warnings non-applicable rules during import." |
| 88 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 89 | +enum VideoSize { |
| 90 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 91 | + `720x1280`, |
| 92 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 93 | + `1280x720`, |
| 94 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 95 | + `1024x1792`, |
| 96 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 97 | + `1792x1024`, |
| 98 | +} |
| 99 | + |
| 100 | +#suppress "@azure-tools/typespec-azure-core/no-enum" "Auto-suppressed warnings non-applicable rules during import." |
| 101 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 102 | +enum VideoSeconds { |
| 103 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 104 | + `4`, |
| 105 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 106 | + `8`, |
| 107 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 108 | + `12`, |
| 109 | +} |
| 110 | + |
| 111 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 112 | +model VideoListResource { |
| 113 | + /** The type of object returned, must be `list`. */ |
| 114 | + #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import." |
| 115 | + @extension("x-stainless-const", true) |
| 116 | + object: "list" = "list"; |
| 117 | + |
| 118 | + /** A list of items */ |
| 119 | + data: VideoResource[]; |
| 120 | + |
| 121 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 122 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 123 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 124 | + first_id: string | null; |
| 125 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 126 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 127 | + #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import." |
| 128 | + last_id: string | null; |
| 129 | + |
| 130 | + /** Whether there are more items available. */ |
| 131 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 132 | + has_more: boolean; |
| 133 | +} |
| 134 | + |
| 135 | +/** Parameters for creating a new video generation job. */ |
| 136 | +@summary("Create video request") |
| 137 | +model CreateVideoBody { |
| 138 | + /** The video generation model to use. Defaults to `sora-2`. */ |
| 139 | + `model`?: HttpPart<VideoModel>; |
| 140 | + |
| 141 | + /** Text prompt that describes the video to generate. */ |
| 142 | + prompt: HttpPart<VideoPrompt>; |
| 143 | + |
| 144 | + /** Optional image reference that guides generation. */ |
| 145 | + #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import." |
| 146 | + input_reference?: HttpPart<bytes>; |
| 147 | + |
| 148 | + /** Clip duration in seconds. Defaults to 4 seconds. */ |
| 149 | + seconds?: HttpPart<VideoSeconds>; |
| 150 | + |
| 151 | + /** Output resolution formatted as width x height. Defaults to 720x1280. */ |
| 152 | + size?: HttpPart<VideoSize>; |
| 153 | +} |
| 154 | + |
| 155 | +/** Confirmation payload returned after deleting a video. */ |
| 156 | +@summary("Deleted video response") |
| 157 | +model DeletedVideoResource { |
| 158 | + /** The object type that signals the deletion response. */ |
| 159 | + #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import." |
| 160 | + @extension("x-stainless-const", true) |
| 161 | + object: "video.deleted" = "video.deleted"; |
| 162 | + |
| 163 | + /** Indicates that the video resource was deleted. */ |
| 164 | + deleted: boolean; |
| 165 | + |
| 166 | + /** Identifier of the deleted video. */ |
| 167 | + id: string; |
| 168 | +} |
| 169 | + |
| 170 | +/** Parameters for remixing an existing generated video. */ |
| 171 | +@summary("Create video remix request") |
| 172 | +model CreateVideoRemixBody { |
| 173 | + /** Updated text prompt that directs the remix generation. */ |
| 174 | + prompt: HttpPart<VideoPrompt>; |
| 175 | +} |
| 176 | + |
| 177 | +@maxLength(32000) |
| 178 | +@minLength(1) |
| 179 | +scalar VideoPrompt extends string; |
| 180 | + |
| 181 | +#suppress "@azure-tools/typespec-azure-core/no-enum" "Auto-suppressed warnings non-applicable rules during import." |
| 182 | +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 183 | +enum VideoContentVariant { |
| 184 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 185 | + video, |
| 186 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 187 | + thumbnail, |
| 188 | + #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import." |
| 189 | + spritesheet, |
| 190 | +} |
0 commit comments