Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions specification/ai/Azure.AI.Unified/common/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -287,43 +287,55 @@ union ExtraParameters {
// Define a URI alias for clarity.
alias Uri = string;

enum PendingUploadType {
None,
TemporaryBlobReference,
@doc("The type of pending upload.")
union PendingUploadType {
string,

@doc("No pending upload.")
none: "None",

@doc("Temporary Blob Reference is the only supported type.")
temporaryBlobReference: "TemporaryBlobReference",
}

enum PendingUploadCredentialType {
SAS,
@doc("The type of credential used to access the storage account.")
union PendingUploadCredentialType {
string,

@doc("SAS credential type.")
sas: "SAS",
}

@doc("Represents a request for a pending upload.")
model PendingUploadRequest {
/// If PendingUploadId is not provided, a random guid will be used.
@doc("If PendingUploadId is not provided, a random GUID will be used.")
pendingUploadId?: string;

/// TemporaryBlobReference is the only supported type.
pendingUploadType: PendingUploadType.TemporaryBlobReference;
@doc("TemporaryBlobReference is the only supported type.")
pendingUploadType: PendingUploadType.temporaryBlobReference;
}

@doc("Represents the response for a pending upload request")
model PendingUploadResponse {
/// Container-level read, write, list SAS.
@doc("Container-level read, write, list SAS.")
blobReferenceForConsumption: BlobReferenceForConsumption;

/// ID for this upload request.
@doc("ID for this upload request.")
pendingUploadId: string;

/// TemporaryBlobReference is the only supported type.
pendingUploadType: PendingUploadType.TemporaryBlobReference;
@doc("TemporaryBlobReference is the only supported type")
pendingUploadType: PendingUploadType.temporaryBlobReference;
}

@doc("Represents a reference to a blob for consumption")
model BlobReferenceForConsumption {
/// Blob URI path for client to upload data.
/// Example: https://blob.windows.core.net/Container/Path
@doc("Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path")
blobUri: Uri;

/// ARM ID of the storage account to use.
@doc("ARM ID of the storage account to use.")
storageAccountArmId: string;

/// Credential info to access the storage account.
@doc("Credential info to access the storage account.")
credential: SasCredential;
}

Expand Down
3 changes: 3 additions & 0 deletions specification/ai/Azure.AI.Unified/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ linter:
- "@azure-tools/typespec-azure-rulesets/data-plane"
disable:
"@azure-tools/typespec-azure-core/casing-style": "Since we have many names in the form XxxxAIXxxx"
"@azure-tools/typespec-azure-core/no-string-discriminator": "Use an extensible union instead of a plain string"
"@azure-tools/typespec-azure-core/bad-record-type": "We do want to use Record<unknown>, and not Record<string>. But this needs further investigation"
"@azure-tools/typespec-azure-core/use-standard-names": "PUT operations that return 200 should start with 'replace' or 'createOrReplace'"
Loading
Loading