Skip to content
33 changes: 33 additions & 0 deletions specification/ai/Azure.AI.Projects/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,36 @@ import "./main.tsp";
using Azure.ClientGenerator.Core;

@@clientName(Azure.AI.Projects, "AIProjectClient");

// Shorter method names for SDK datasets operations
@@clientName(Azure.AI.Projects.Datasets.listLatest, "list");
@@clientName(Azure.AI.Projects.Datasets.getVersion, "get");
@@clientName(Azure.AI.Projects.Datasets.deleteVersion, "delete");
@@clientName(Azure.AI.Projects.Datasets.createOrUpdateVersion,
"createOrUpdate"
);
@@clientName(Azure.AI.Projects.Datasets.startPendingUploadVersion,
"pendingUpload"
);

// Shorter method names for SDK Index operations
@@clientName(Azure.AI.Projects.Indexes.listLatest, "list");
@@clientName(Azure.AI.Projects.Indexes.getVersion, "get");
@@clientName(Azure.AI.Projects.Indexes.deleteVersion, "delete");
@@clientName(Azure.AI.Projects.Indexes.createOrUpdateVersion, "createOrUpdate");

// In Python, the emitter changes "keys" to "keys_property", since there is already
// a "keys" method in the generated code due to usage of MutableMapping. Call it credential_keys instead.
@@clientName(Azure.AI.Projects.CustomCredential.keys,
"credential_keys",
"python"
);

// Make these two internal, since all SDKs hand-write a single public method with boolean "includeCredentials"
// input parameter that calls either on these two.
@@access(Azure.AI.Projects.Connections.get, Access.internal);
@@access(Azure.AI.Projects.Connections.getWithCredentials, Access.internal);

// For some reason for Python the emitter creates an empty ServicePatternsOperations operation
// class. Mark it as internal here. Apply to all languages just in case.
//@@access(Azure.AI.Projects.ServicePatterns, Access.internal); <== this did not work. It makes all methods internal.
2 changes: 1 addition & 1 deletion specification/ai/Azure.AI.Projects/connections/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ model EntraIDCredentials extends BaseCredentials {
type: CredentialType.entraId;
}

@doc("Custom credential defintion")
@doc("Custom credential definition")
model CustomCredential extends BaseCredentials {
@doc("The credential type")
@visibility(Lifecycle.Read)
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/Azure.AI.Projects/datasets/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface Datasets

#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@doc("Get download sas for dataset version.")
@doc("Get the SAS credential to access the storage account associated with a Dataset version.")
@post
@Rest.action("credentials")
@Rest.actionSeparator("/")
Expand Down
18 changes: 10 additions & 8 deletions specification/ai/Azure.AI.Projects/servicepatterns.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ namespace Azure.AI.Projects.ServicePatterns {
createOrUpdateVersion is Azure.Core.Foundations.ResourceOperation<
TEntityType,
{
@doc("The definition of the {name} to create or update", TEntityType)
@Http.bodyRoot
body: TEntityType;

@doc(
"The specific version id of the {name} to create or replace.",
TEntityType
)
@Rest.segment("versions")
@Http.path
version: string;

@doc("The definition of the {name} to create or update", TEntityType)
@Http.bodyRoot
body: TEntityType;
},
Azure.Core.Foundations.ResourceCreatedOrOkResponse<TEntityType>
>;
Expand All @@ -104,14 +104,14 @@ namespace Azure.AI.Projects.ServicePatterns {
> is Azure.Core.Foundations.ResourceOperation<
TEntityType,
{
@doc("Parameters for the action")
@Http.bodyRoot
body: TParams;

@doc("The specific version id of the {name} to operate on.", TEntityType)
@Rest.segment("versions")
@Http.path
version: string;

@doc("Parameters for the action")
@Http.bodyRoot
body: TParams;
},
TResponse
>;
Expand All @@ -135,8 +135,10 @@ namespace Azure.AI.Projects.ServicePatterns {

namespace BuildingBlocks {
alias CoreOps = Azure.Core.StandardResourceOperations;
/*
alias RepeatableCoreOps = Azure.Core.ResourceOperations<Azure.Core.Traits.SupportsRepeatableRequests &
Azure.Core.Traits.SupportsClientRequestId &
Azure.Core.Traits.NoConditionalRequests>;
*/
}
}
4 changes: 3 additions & 1 deletion specification/ai/Azure.AI.Projects/suppressions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
# Suppress JS package & dir names related to RLC, which require "rest" in the name. We do not use RLC.
- options.@azure-tools/typespec-ts.package-dir
- options.@azure-tools/typespec-ts.package-details.name
reason: 'We do not yet have a Go client library. We do not use RLC for JS.'
# Do not force me to generate Python samples
- options.@azure-tools/typespec-python.generate-sample
reason: 'See above comments for details'
2 changes: 1 addition & 1 deletion specification/ai/Azure.AI.Projects/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ options:
api-version: "2025-05-15-preview"
flavor: azure
generate-test: true
generate-sample: true
generate-sample: false
"@azure-tools/typespec-csharp":
package-mode: "dataplane"
package-dir: "Azure.AI.Projects"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
"/datasets/{name}/versions/{version}/credentials": {
"post": {
"operationId": "Datasets_GetCredentials",
"description": "Get download sas for dataset version.",
"description": "Get the SAS credential to access the storage account associated with a Dataset version.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
Expand Down Expand Up @@ -2379,7 +2379,7 @@
},
"CustomCredential": {
"type": "object",
"description": "Custom credential defintion",
"description": "Custom credential definition",
"properties": {
"keys": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
"/datasets/{name}/versions/{version}/credentials": {
"post": {
"operationId": "Datasets_GetCredentials",
"description": "Get download sas for dataset version.",
"description": "Get the SAS credential to access the storage account associated with a Dataset version.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
Expand Down Expand Up @@ -1683,7 +1683,7 @@
},
"CustomCredential": {
"type": "object",
"description": "Custom credential defintion",
"description": "Custom credential definition",
"properties": {
"keys": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
"/datasets/{name}/versions/{version}/credentials": {
"post": {
"operationId": "Datasets_GetCredentials",
"description": "Get download sas for dataset version.",
"description": "Get the SAS credential to access the storage account associated with a Dataset version.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
Expand Down Expand Up @@ -1683,7 +1683,7 @@
},
"CustomCredential": {
"type": "object",
"description": "Custom credential defintion",
"description": "Custom credential definition",
"properties": {
"keys": {
"type": "object",
Expand Down
Loading