Skip to content
Merged
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
Formatting update
  • Loading branch information
johanste committed Mar 18, 2025
commit 9dd5c92e9a656a125d074750979658330b0c39cc
30 changes: 21 additions & 9 deletions specification/ai/Azure.AI.Projects/servicepatterns.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ namespace Azure.AI.Projects.ServicePatterns {
TListLatestParameters extends Reflection.Model = {},
TListVersionsParameters extends Reflection.Model = {}
> {

#suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block."
@doc("List all versions of the given {name}", TEntityType)
@Rest.action("versions")
@Rest.actionSeparator("/")
@Http.get
#suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block."
listVersions is BuildingBlocks.CoreOps.ResourceAction<
TEntityType,
TListVersionsParameters,
Expand Down Expand Up @@ -54,29 +53,40 @@ namespace Azure.AI.Projects.ServicePatterns {
Http.NoContentResponse
>;

@doc("Create a new {name}. The version id will be generated by the service.", TEntityType)
@doc(
"Create a new {name}. The version id will be generated by the service.",
TEntityType
)
@Rest.actionSeparator("/")
versions is BuildingBlocks.RepeatableCoreOps.ResourceAction<
TEntityType,
{
@doc("The definition of the {name} to create", TEntityType)
@Http.bodyRoot body: TEntityType;
@Http.bodyRoot
body: TEntityType;
},
TEntityType
>;

@doc("Create a new or replace an existing {name} with the given version id", TEntityType)
@doc(
"Create a new or replace an existing {name} with the given version id",
TEntityType
)
@Http.put
createVersion is Azure.Core.Foundations.ResourceOperation<
TEntityType,
{
@doc("The specific version id of the {name} to create or replace.", 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", TEntityType)
@Http.bodyRoot body: TEntityType;
@Http.bodyRoot
body: TEntityType;
},
Azure.Core.Foundations.ResourceCreatedOrOkResponse<TEntityType>
>;
Expand All @@ -96,14 +106,16 @@ namespace Azure.AI.Projects.ServicePatterns {
version: string;

@doc("Parameters for the action")
@Http.bodyRoot body: TParams;
@Http.bodyRoot
body: TParams;
},
TResponse
>;

namespace BuildingBlocks {
alias CoreOps = Azure.Core.StandardResourceOperations;
alias RepeatableCoreOps = Azure.Core.ResourceOperations<Azure.Core.Traits.SupportsRepeatableRequests &
Azure.Core.Traits.SupportsClientRequestId & Azure.Core.Traits.NoConditionalRequests>;
Azure.Core.Traits.SupportsClientRequestId &
Azure.Core.Traits.NoConditionalRequests>;
}
}
Loading