|
| 1 | +import "@typespec/rest"; |
| 2 | +import "@azure-tools/typespec-autorest"; |
| 3 | +import "@typespec/versioning"; |
| 4 | +import "@azure-tools/typespec-azure-core"; |
| 5 | +import "./common.tsp"; |
| 6 | +import "@typespec/openapi"; |
| 7 | +import "@typespec/versioning"; |
| 8 | + |
| 9 | +using TypeSpec.OpenAPI; |
| 10 | +using TypeSpec.Http; |
| 11 | +using TypeSpec.Rest; |
| 12 | +using TypeSpec.Versioning; |
| 13 | +using Azure.Core; |
| 14 | +using Azure.Core.Traits; |
| 15 | + |
| 16 | +namespace Microsoft.MachineLearningServices; |
| 17 | + |
| 18 | +@doc("AssetVersion Definition") |
| 19 | +model AssetVersion { |
| 20 | + @doc("Fully qualified resource Id: azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index.") |
| 21 | + @visibility("read") |
| 22 | + id: string; |
| 23 | + |
| 24 | + @doc("Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development.") |
| 25 | + stage?: string = "Development"; |
| 26 | + |
| 27 | + @doc("Description information of the asset.") |
| 28 | + description?: string; |
| 29 | + |
| 30 | + @doc("Metadata containing createdBy and modifiedBy information.") |
| 31 | + @visibility("read") |
| 32 | + systemData?: SystemData; |
| 33 | + |
| 34 | + @doc("Asset's tags. Unlike properties, tags are fully mutable.") |
| 35 | + tags?: Record<string>; |
| 36 | + |
| 37 | + @doc("Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.") |
| 38 | + properties?: Record<string>; |
| 39 | +} |
| 40 | + |
| 41 | +@doc("Index resource Definition") |
| 42 | +model Index is AssetVersion { |
| 43 | + @doc("Default workspace blob storage Uri. Should work across storage types and auth scenarios.") |
| 44 | + storageUri: string; |
| 45 | +} |
| 46 | + |
| 47 | +@doc("Paged collection of IndexVersion items.") |
| 48 | +@pagedResult |
| 49 | +model PagedIndex { |
| 50 | + @doc("The list of Indexes.") |
| 51 | + @extension("x-ms-identifiers", []) |
| 52 | + @items |
| 53 | + value: Index[]; |
| 54 | + |
| 55 | + @doc("The link to the next page of items") |
| 56 | + @nextLink |
| 57 | + nextLink?: ResourceLocation<Index>; |
| 58 | +} |
| 59 | + |
| 60 | +@doc("Prompt resource definition") |
| 61 | +@added(Versions.`2024-05-01-preview`) |
| 62 | +model Prompt is AssetVersion { |
| 63 | + @doc("Default workspace blob storage Ui. Should work across storage types and auth scenarios.") |
| 64 | + dataUri: string; |
| 65 | + |
| 66 | + @doc("Relative path of the prompt data file at the dataUri location") |
| 67 | + templatePath: string; |
| 68 | +} |
| 69 | + |
| 70 | +@doc("Paged collection of PromptVersion items") |
| 71 | +@pagedResult |
| 72 | +@added(Versions.`2024-05-01-preview`) |
| 73 | +model PagedPrompt { |
| 74 | + @doc("The list of Prompts.") |
| 75 | + @extension("x-ms-identifiers", []) |
| 76 | + @items |
| 77 | + value: Prompt[]; |
| 78 | + |
| 79 | + @doc("The link to the next page of items") |
| 80 | + @nextLink |
| 81 | + nextLink?: ResourceLocation<Prompt>; |
| 82 | +} |
| 83 | + |
| 84 | +@doc("Next version definition.") |
| 85 | +model VersionInfo { |
| 86 | + @doc("Next version as defined by the server. The server keeps track of all versions that are string-representations of integers. If one exists, the nextVersion will be a string representation of the highest integer value + 1. Otherwise, the nextVersion will default to '1'.") |
| 87 | + nextVersion?: int64; |
| 88 | + |
| 89 | + @doc("Current latest version of the resource.") |
| 90 | + latestVersion: string; |
| 91 | +} |
| 92 | + |
| 93 | +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" |
| 94 | +alias ResourceCreatedResponse<T extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<201> & |
| 95 | + T; |
| 96 | + |
| 97 | +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" |
| 98 | +alias ResourceCreatedOrOkResponse<T extends TypeSpec.Reflection.Model> = ResourceCreatedResponse<T> | (TypeSpec.Http.Response<200> & |
| 99 | + T); |
0 commit comments