Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
address Yanxiang's comment on IM
  • Loading branch information
dargilco committed Apr 23, 2025
commit 8855a0db95eb141cc1d1e11d47a8698357bbe5e3
16 changes: 8 additions & 8 deletions specification/ai/Azure.AI.Projects/connections/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Azure.AI.Projects;

@doc("Response from the list and get connections operations")
@resource("connections")
@discriminator("authType")
@added(Versions.v2025_05_01)
model Connection {
@doc("The name of the resource")
Expand Down Expand Up @@ -42,18 +41,18 @@ model Connection {
}

@doc("A base class for connection credentials")
@discriminator("authType")
@discriminator("type")
model BaseCredentials {
@doc("The type of credential used by the connection")
@visibility(Lifecycle.Read)
authType: CredentialType;
type: CredentialType;
}

@doc("API Key Credential definition")
model ApiKeyCredentials extends BaseCredentials {
@doc("The credentail type")
@visibility(Lifecycle.Read)
authType: CredentialType.apiKey;
type: CredentialType.apiKey;

@doc("API Key")
@visibility(Lifecycle.Read)
Expand All @@ -66,33 +65,34 @@ model ApiKeyCredentials extends BaseCredentials {
model EntraIDCredentials extends BaseCredentials {
@doc("The credential type")
@visibility(Lifecycle.Read)
authType: CredentialType.entraId;
type: CredentialType.entraId;
}

@doc("Custom credential defintion")
model CustomCredential extends BaseCredentials {
@doc("The credential type ")
@visibility(Lifecycle.Read)
authType: CredentialType.custom;
type: CredentialType.custom;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("Shared Access Signature (SAS) credential definition")
model SASCredentials extends BaseCredentials {
@doc("The credential type")
@visibility(Lifecycle.Read)
authType: CredentialType.SAS;
type: CredentialType.SAS;

@doc("SAS token")
@visibility(Lifecycle.Read)
@encodedName("application/json", "SAS")
sasToken?: string;
}

@doc("Credentials that do not require authentication")
model NoAuthenticationCredentials extends BaseCredentials {
@doc("The credential type ")
@visibility(Lifecycle.Read)
authType: CredentialType.None;
type: CredentialType.None;
}

// https://learn.microsoft.com/rest/api/azureml/workspace-connections/list-secrets?view=rest-azureml-2024-04-01&tabs=HTTP#ConnectionType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1922,15 +1922,15 @@
"type": "object",
"description": "A base class for connection credentials",
"properties": {
"authType": {
"type": {
"$ref": "#/definitions/CredentialType",
"description": "The type of credential used by the connection",
"readOnly": true
}
},
"discriminator": "authType",
"discriminator": "type",
"required": [
"authType"
"type"
]
},
"BlobReferenceForConsumption": {
Expand Down Expand Up @@ -1960,10 +1960,6 @@
"type": "object",
"description": "Response from the list and get connections operations",
"properties": {
"authType": {
"type": "string",
"description": "Discriminator property for Connection."
},
"name": {
"type": "string",
"description": "The name of the resource",
Expand Down Expand Up @@ -1998,9 +1994,7 @@
"readOnly": true
}
},
"discriminator": "authType",
"required": [
"authType",
"name",
"type",
"target",
Expand Down Expand Up @@ -3196,10 +3190,11 @@
"type": "object",
"description": "Shared Access Signature (SAS) credential definition",
"properties": {
"sasToken": {
"SAS": {
"type": "string",
"description": "SAS token",
"readOnly": true
"readOnly": true,
"x-ms-client-name": "sasToken"
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,15 +1294,15 @@
"type": "object",
"description": "A base class for connection credentials",
"properties": {
"authType": {
"type": {
"$ref": "#/definitions/CredentialType",
"description": "The type of credential used by the connection",
"readOnly": true
}
},
"discriminator": "authType",
"discriminator": "type",
"required": [
"authType"
"type"
]
},
"BlobReferenceForConsumption": {
Expand Down Expand Up @@ -1332,10 +1332,6 @@
"type": "object",
"description": "Response from the list and get connections operations",
"properties": {
"authType": {
"type": "string",
"description": "Discriminator property for Connection."
},
"name": {
"type": "string",
"description": "The name of the resource",
Expand Down Expand Up @@ -1370,9 +1366,7 @@
"readOnly": true
}
},
"discriminator": "authType",
"required": [
"authType",
"name",
"type",
"target",
Expand Down Expand Up @@ -2292,10 +2286,11 @@
"type": "object",
"description": "Shared Access Signature (SAS) credential definition",
"properties": {
"sasToken": {
"SAS": {
"type": "string",
"description": "SAS token",
"readOnly": true
"readOnly": true,
"x-ms-client-name": "sasToken"
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,15 +1294,15 @@
"type": "object",
"description": "A base class for connection credentials",
"properties": {
"authType": {
"type": {
"$ref": "#/definitions/CredentialType",
"description": "The type of credential used by the connection",
"readOnly": true
}
},
"discriminator": "authType",
"discriminator": "type",
"required": [
"authType"
"type"
]
},
"BlobReferenceForConsumption": {
Expand Down Expand Up @@ -1332,10 +1332,6 @@
"type": "object",
"description": "Response from the list and get connections operations",
"properties": {
"authType": {
"type": "string",
"description": "Discriminator property for Connection."
},
"name": {
"type": "string",
"description": "The name of the resource",
Expand Down Expand Up @@ -1370,9 +1366,7 @@
"readOnly": true
}
},
"discriminator": "authType",
"required": [
"authType",
"name",
"type",
"target",
Expand Down Expand Up @@ -2292,10 +2286,11 @@
"type": "object",
"description": "Shared Access Signature (SAS) credential definition",
"properties": {
"sasToken": {
"SAS": {
"type": "string",
"description": "SAS token",
"readOnly": true
"readOnly": true,
"x-ms-client-name": "sasToken"
}
},
"allOf": [
Expand Down
Loading